[Python-3000] Fixing super anyone?
collinw at gmail.com
Tue Apr 24 03:03:31 CEST 2007
On 4/23/07, Jim Jewett <jimjjewett at gmail.com> wrote:
> If we're willing to put up with the magic, then it would work to make
> super syntactic sugar for
> super(__this_class__, self)
> At the moment, I can't see anything wrong with this, but I have a
> feeling I'm missing something about how the super object should behave
> on its own.
You mean, have "super.method_name(*args)" expanded by the AST compiler
into super(__this_class__, self).method_name(*args)"? The object
reference -> function call change is too much magic; -1.
However, having the AST compiler expand
super = super_factory(A)
strikes me as an "appropriate" amount of magic. Restricting the magic
to a source transformation should enable other Python implementations
to implement this relatively easily.
More information about the Python-3000