Possible additions to the standard library? (WAS: About standardlibrary improvement)

Kent Johnson kent3737 at yahoo.com
Fri Feb 4 17:33:17 EST 2005


Daniel Bickett wrote:
> |    def reverse( self ):
> |        """
> |        Return a reversed copy of string.
> |        """
> |        string = [ x for x in self.__str__() ]
> |        string.reverse()
> |        return ''.join( string )

def reverse(self):
     return self[::-1]

Kent



More information about the Python-list mailing list