very good reasons?

Greg Ewing see at my.signature
Sun Oct 1 22:17:05 EDT 2000


Pete Shinners wrote:
> 
> b = a.sort() or a.reverse() or a

Yeeek! That must be the most misleading piece of
Python I've ever seen! It sounds like you're
either sorting or reversing or doing nothing,
when you're actually doing all three.

If you really want an obfuscated way of writing
it, how about

b = (a.sort(), a.reverse(), a)[-1]

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list