[Python-bugs-list] [ python-Bugs-722763 ] weakref: proxy_print and proxy_repr incons.

SourceForge.net noreply@sourceforge.net
Wed, 16 Apr 2003 14:49:19 -0700


Bugs item #722763, was opened at 2003-04-16 17:49
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=722763&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: weakref: proxy_print and proxy_repr incons.

Initial Comment:
For weakref.proxy, the behavior of proxy_print() in
"cooked" mode is inconsistent with the behavior of
proxy_repr(). "cooked" mode printing is used when a
value is displayed at the command line. Sample session:

>>> class C: pass
... 
>>> from weakref import proxy
>>> a = C()
>>> p = proxy(a)
>>> p
<__main__.C instance at 0x400e864c>
>>> print repr(p)
<weakproxy at 0x400e343c to instance at 0x400e864c>
>>>

The output should be the same in both cases.

(My suggestion: get rid of proxy_print. Might be a tad
slower in extreme cases, but gets this right with ease. :-)

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

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