[Python-ideas] How can I get own instance of generator in itself code

Chris Rebert pyideas at rebertia.com
Sun Jul 22 22:33:53 CEST 2012


On Mon, Jul 16, 2012 at 12:12 AM, David Townshend <aquavitae69 at gmail.com> wrote:
> On Jul 16, 2012 4:04 AM, "Chris Rebert" <pyideas at rebertia.com> wrote:
<snip>
>> Given that PEP 3130 (http://www.python.org/dev/peps/pep-3130/ ), which
>> would have similarly added nice ways to get the current module, class,
>> and regular function, was rejected, I wouldn't hold out much hope for
>> such a feature being added any time soon.
>> (Wrapping via decorators introduces nontrivial subtlety regarding
>> whether you really want to refer to the decorated or undecorated
>> version of an entity.)
<snip>
> The problem with PEP 3130 was the PEP itself, not the idea.

Could you elaborate on how the PEP and the "idea" materially differed?

> I believe Eric
> Snow was working on a patch to implement this (see
> http://code.activestate.com/lists/python-ideas/11234/ and
> http://bugs.python.org/issue12857), but I'm not sure what its current status
> is.

I would hardly describe mucking around with frame objects as "nice"
(particularly compared against a dedicated keyword), so I would not
say that it implements the same idea; though, to be sure, what the
patch accomplishes is related, still useful, and could be used to
power the implementation of something like the PEP.

Belated regards,
Chris
--
Please avoid top-posting in the future :)



More information about the Python-ideas mailing list