[Python-bugs-list] [ python-Bugs-591704 ] generators can't be weakly referenced
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 06 Aug 2002 12:10:22 -0700
Bugs item #591704, was opened at 2002-08-06 15:10
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=591704&group_id=5470
Category: Python Interpreter Core
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: H. Richard Harkins (hrharkins)
Assigned to: Nobody/Anonymous (nobody)
Summary: generators can't be weakly referenced
Initial Comment:
I can't seem to weakly reference generators. I can't
think of a good reason that this shouldn't work. Here
is a code snippet to demonstrate the issue:
>>> from __future__ import generators
>>> import weakref
>>> def f():
... yield "HELLO"
...
>>> weakref.proxy(f())
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: cannot create weak reference to 'generator'
object
>>>
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=591704&group_id=5470