Sort all values in this SArray.

        Sort only works for sarray of type str, int and float, otherwise TypeError
        will be raised. Creates a new, sorted SArray.

        Parameters
        ----------
        ascending: boolean, optional
           If true, the sarray values are sorted in ascending order, otherwise,
           descending order.

        Returns
        -------
        out: SArray

        Examples
        --------
        >>> sa = SArray([3,2,1])
        >>> sa.sort()
        dtype: int
        Rows: 3
        [1, 2, 3]

def sort(self, ascending=True):
        """
        Sort all values in this SArray.

        Sort only works for sarray of type str, int and float, otherwise TypeError
        will be raised. Creates a new, sorted SArray.

        Parameters
        ----------
        ascending: boolean, optional
           If true, the sarray values are sorted in ascending order, otherwise,
           descending order.

        Returns
        -------
        out: SArray

        Examples
        --------
        >>> sa = SArray([3,2,1])
        >>> sa.sort()
        dtype: int
        Rows: 3
        [1, 2, 3]
        """
        from .sframe import SFrame as _SFrame

        if self.dtype not in (int, float, str, datetime.datetime):
            raise TypeError("Only sarray with type (int, float, str, datetime.datetime) can be sorted")
        sf = _SFrame()
        sf['a'] = self
        return sf.sort('a', ascending)['a']