Message86826
The docs say that "If a class defines __repr__() but not __str__(), then
__repr__() is also used when an “informal” string representation of
instances of that class is required."
but, repr is ignored:
>>> class E(Exception):
... def __repr__(self):
... return 'fancy!'
...
>>> raise E()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
__main__.E
only str is respected:
>>> class E(Exception):
... def __str__(self):
... return 'fancy!'
...
>>> raise E()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
__main__.E: fancy! |
|
Date |
User |
Action |
Args |
2009-04-29 21:36:18 | ellisj | set | recipients:
+ ellisj |
2009-04-29 21:36:17 | ellisj | set | messageid: <1241040977.95.0.976724243821.issue5882@psf.upfronthosting.co.za> |
2009-04-29 21:36:16 | ellisj | link | issue5882 messages |
2009-04-29 21:36:15 | ellisj | create | |
|