[Python-3000] pyvm module - low level interface to Python's VM
Nick Coghlan
ncoghlan at gmail.com
Mon Dec 3 13:18:33 CET 2007
Phillip J. Eby wrote:
> Well, for what class-level frame hacking is typically used for, it
> would suffice to have a convenient way to refer to the local
> namespace, e.g. if you could do something like:
>
> implements(@, IExample)
>
> where @ was a shortcut for locals(). The most-used frame hacks (in
> zope.interface and most PEAK tools) just want to access the namespace
> of the current class definition, and maybe decorate the class in some way.
Aren't the metaclass changes in PEP 3115 partially aimed at eliminating
the need for stack frame hackery to implement these kinds of things?
(e.g. the metaclass could stuff a closure into the class namespace under
the name 'implements' to avoid any need for frame hackery).
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
More information about the Python-3000
mailing list