At 01:19 PM 4/29/2007 -0400, Calvin Spealman wrote:
Backward compatability of the super type API raises some issues. Names, the lookup of the __call__ of the super type itself, which means a conflict with doing an actual super lookup of the __call__ attribute. Namely, the following is ambiguous in the current proposal:
Which means the backward compatible API, which involves instansiating the super type, will either not be possible, because it will actually do a super lookup on the __call__ attribute, or there will be no way to perform a super lookup on the __call__ attribute. Both seem unacceptable, so any suggestions are welcome.
Note that if you have a class with a __call__ method, it will still be called, even if you override __getattribute__ to return something else when asked for the __call__ attribute, e.g.:
... def __call__(self): ... return "called!" ... def __getattribute__(self, attr): ... if attr=='__call__': ... return lambda: "attribute"
dc = DoubleCall() dc()