Why not 3.__class__ ?

Erik Max Francis max at alcyone.com
Tue Oct 9 13:37:06 EDT 2001


Bernhard Herzog wrote:

> IMO something like
> 
> >>> map(1 .__add__, [0, 5, 7, 2])
> [1, 6, 8, 3]
> >>>
> 
> can come in handy. Of course this particular example may be clearer
> with
> list comprehensions.

Or just a lambda:

	lambda(lambda x: x + 1, [0, 5, 7, 2])

I'd call that a lot more readable.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ The purpose of man's life is not happiness but worthiness.
\__/ Felix Adler
    The laws list / http://www.alcyone.com/max/physics/laws/
 Laws, rules, principles, effects, paradoxes, etc. in physics.



More information about the Python-list mailing list