Why return None?

Mel Wilson mwilson at the-wire.com
Thu Aug 26 18:21:47 CEST 2004


In article <1gj4fj6.kfkov1iafzb2Nleaxit at yahoo.com>,
aleaxit at yahoo.com (Alex Martelli) wrote:
>In Python 2.4, by the way, reversed(x) [[using the new built-in function
>'reversed']] is most often preferable to x[::-1].  reversed returns an
>iterator, optimized for looping on, but if you need a list, tuple, etc,
>you can just call list(reversed(x)) and so on.

   Now that it's too late, I wish it were called
'reversing', after reading the story of somebody who got an
iterator, thinking it was a thing.  Then made a dictionary
out of it twice, and got one good dict and one empty dict.

   'reverse' and 'reversed' remind me of Extended Memory and
Expanded Memory.  One was one, and one the other, but which
was which?

        Regards.        Mel.



More information about the Python-list mailing list