[Python-Dev] New Super PEP (original) (raw)

Phillip J. Eby pje at telecommunity.com
Sun Apr 29 21:40:10 CEST 2007


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:

:: super.call(arg) 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.:

class DoubleCall(object): ... def call(self): ... return "called!" ... def getattribute(self, attr): ... if attr=='call': ... return lambda: "attribute"

dc = DoubleCall() dc() 'called!' dc.call() 'attribute'



More information about the Python-Dev mailing list