Can't define __call__ within __init__?
steve at REMOVE-THIS-cybersource.com.au
Fri Mar 12 04:24:39 CET 2010
On Thu, 11 Mar 2010 08:20:14 -0800, Steve Howell wrote:
>> (2) special methods like __call__ are only called on the class, not the
>> instance, so you can't give each instance its own method.
> Are you sure about that? This program prints 1, 2, 1, 2.
The rules for classic classes are different. Since classic classes have
gone away in 3.0, and are becoming rarer in 2.x, I didn't bother to
mention the complication.
More information about the Python-list