Forgetting "()" when calling methods

Erik Max Francis max at alcyone.com
Sun Apr 27 03:07:29 EDT 2003


Terry Reedy wrote:

> "Erik Max Francis" <max at alcyone.com> wrote in message
> news:3EAB6A14.707AD826 at alcyone.com...
>
> > # f holds a callable object or None
> > if f:
> >     f(...)
> 
> or
> print f and f() or 'cannot do that' # assumes boo(f()) always True

Shorter is not always better.  This being an awfully good example.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Death to all fanatics!
\__/ Malaclypse the Younger
    Kepler's laws / http://www.alcyone.com/max/physics/kepler/
 A proof of Kepler's laws.




More information about the Python-list mailing list