Can't define __call__ within __init__?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Fri Mar 12 04:30:02 CET 2010


On Thu, 11 Mar 2010 07:56:59 -0500, Neal Becker wrote:

> The example I showed was just a toy problem.  The real problem is I
> expect to call a function many times, and I want to avoid the overhead
> of the 'if blah' everytime.

Unless the __call__ methods are very small, the overhead of one extra if 
and one extra attribute lookup will be insignificant.


-- 
Steven



More information about the Python-list mailing list