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

SourceForge.net noreply at sourceforge.net
Wed Jun 23 16:13:00 EDT 2004


Bugs item #978308, was opened at 2004-06-23 10:48
Message generated for change (Comment added) made by rhettinger
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: 6
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.

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

>Comment By: Raymond Hettinger (rhettinger)
Date: 2004-06-23 15:13

Message:
Logged In: YES 
user_id=80475

Confirmed the script behavior in Py2.4.

The interactive prompt results are not consistent It
returned True the first time I ran it and raised a
ReferenceError in subsequent attempts.

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

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