On 10/1/06, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> But I'm all for adding syntactic sugar to Py3k. Can someone please
> draft a proto-PEP? I think the compiler could treat super as a
> reserved word and turn super.foo(args) into __super__(<thisclass>,
> self).foo(args).

Are you saying that it would be OK to peek inside the function at
compile-time and capture self.__class__ then, rather than waiting for
run-time (when self might really be a subclass instance)?

On its own that seems reasonable, but the "peek early" proposals are
starting to add up, and they aren't all consistent.

   The stuff inside a function definition doesn't get evaluated until
the function is called.

    Except that if it has "yield", that changes the compiler settings.
 Nothing gets evalated, we just peek.

    And a switch creation does get evaluated early (if that happens).

    And a static/once/final variable gets evaluated early (to line up
with switch)

    And a super gets created early, but only halfway.  It freezes
self.__class__, but not the self.__mro__

-jJ
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to