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

Eric Snow ericsnowcurrently at gmail.com
Mon Jul 16 18:28:48 CEST 2012


Yeah, this is still valuable.  However, at this point it would be a 3.4
addition (_if_ it gets committed).  Updating the patch in the tracker is on
my todo for the next few months.

-eric
On Jul 16, 2012 1:13 AM, "David Townshend" <aquavitae69 at gmail.com> wrote:

> The problem with PEP 3130 was the PEP itself, not the idea.  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.
>
> David
>  On Jul 16, 2012 4:04 AM, "Chris Rebert" <pyideas at rebertia.com> wrote:
>
>> On Sat, Jul 14, 2012 at 11:18 PM, Đinh Nho Nam <namdn at socbay.com> wrote:
>> > Hi Python Software Foundation!
>> > I have learned Python for 2 years, and I love this language very much.
>> The structure and grammar are simple and beautiful. I used this language in
>> most of my projects.
>> > Now, I learn to use generator. This architecture is very intelligent.
>> It allows programmer can pause and resume function. I think that this
>> feature is not supported in classic language as C++, Java, C#.. In my
>> design, we use 1 generator in both tasks: invoke and callback when download
>> one url. But I have a small problem when getting instance of generator. How
>> can I get own instance of generator in itself code?
>> <snip>
>> > How can we do as this code. How can I get self variable?. Does the
>> language support this feature? I cannot find it in any document in
>> python.org.
>> <snip>
>> > Can you add this feature in the next version of python???
>>
>> 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.)
>>
>> Cheers,
>> Chris
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> http://mail.python.org/mailman/listinfo/python-ideas
>>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20120716/1e714c3b/attachment.html>


More information about the Python-ideas mailing list