Can't define __call__ within __init__?

Andre Engels andreengels at gmail.com
Thu Mar 11 09:14:45 EST 2010


On Thu, Mar 11, 2010 at 2:30 PM, Steve Holden <steve at holdenweb.com> 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.
>>
> This is a premature optimization. First, make it work. Then (if it
> doesn't work fast enough) make it work faster.

Corrolary: When you do make it faster, make it faster where it is slow.
Second corrolary: If making it fast is so important that these two
rules do not apply, Python is not your language of choice.


-- 
André Engels, andreengels at gmail.com



More information about the Python-list mailing list