[Python-3000] auto-super()
Aahz
aahz at pythoncraft.com
Mon Apr 17 05:18:58 CEST 2006
On Sun, Apr 16, 2006, Michael P. Soulier wrote:
> On 17/04/06 Greg Ewing said:
>>
>> The other possible reason for using super() is so you don't have
>> to write the name of the base class into all your inherited method
>> calls. But that's a separate issue that would be better addressed by
>> a different mechanism, rather than conflating the two in super().
>
> Although you do have to put the current class name in the method
> calls, as super() requires it as the first argument. I never
> understood that. Why would I wish to use super(Bar) if I'm in class
> Foo? Cannot Foo be implied here?
Remember that in its current form super() is a regular function; it
cannot be implied without stack hackery. The autosuper metaclass should
probably become part of the regular type metaclass in 3.0, but I think
that requires a PEP -- and in keeping with Guido's recent admonishment,
someone should probably try implementing it first and see what happens
with the test suite.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"LL YR VWL R BLNG T S"
More information about the Python-3000
mailing list