[Python-bugs-list] [ python-Bugs-666958 ] repr.repr not always safe
SourceForge.net
noreply@sourceforge.net
Sun, 12 Jan 2003 20:17:41 -0800
Bugs item #666958, was opened at 2003-01-12 23:17
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=666958&group_id=5470
Category: Python Library
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Bob Ippolito (etrepum)
Assigned to: Nobody/Anonymous (nobody)
Summary: repr.repr not always safe
Initial Comment:
>>> class A:
... def __repr__(self):
... raise Exception
... def someMethod(self):
... pass
...
>>> A()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<stdin>", line 3, in __repr__
Exception
>>> repr.repr(A())
'<A instance at 237360>'
>>> repr.repr(A().someMethod)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/repr.py", line 15, in repr
return self.repr1(x, self.maxlevel)
File "/usr/lib/python2.2/repr.py", line 24, in repr1
s = `x`
File "<stdin>", line
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=666958&group_id=5470