[ python-Bugs-978308 ] Spurious errors taking bool of dead proxy

SourceForge.net noreply at sourceforge.net
Wed Jun 23 11:48:54 EDT 2004


Bugs item #978308, was opened at 2004-06-23 11:48
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=978308&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris King (colander_man)
Assigned to: Nobody/Anonymous (nobody)
Summary: Spurious errors taking bool of dead proxy

Initial Comment:
The following code will cause interesting errors:

from weakref import proxy
class a: pass
bool(proxy(a()))

Entered at a prompt, this will not cause a
ReferenceError until another statement is entered (and
will instead return True or 1) in both 2.3 and 2.2.

Run as a script, this will return True and cause a
fatal error in 2.3, but will return 1 and otherwise
exhibit no strange behaviour in 2.2 (even with
additional code accessing the return value).

The equivalent code written using ref rather than proxy
works as expected: bool(ref(a())()) returns False and
creates no errors.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=978308&group_id=5470



More information about the Python-bugs-list mailing list