Why not 3.__class__ ?

Bernhard Herzog bh at intevation.de
Tue Oct 9 13:17:08 EDT 2001


David Bolen <db3l at fitlinxx.com> writes:

> but why would you ever invoke a method on a numeric literal in your source?

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.

   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                               http://mapit.de/



More information about the Python-list mailing list