looking for speed-up ideas

Tim Peters tim.one at comcast.net
Tue Feb 4 14:22:03 EST 2003


[Ram Bhamidipaty]
> ...
> class FileSize:
>     def __init__(self,name,size):
>         self.name = name
>         self.size = size
>     def __le__(self,other):
>         if self.size <= other.size:
>             return 1
>         else:
>             return 0

Just nothing that

          return self.size <= other.size

is simpler/clearer/faster.





More information about the Python-list mailing list