Message134238
I guess I was confused by the inconsistency with Python 3, which *does* call the __str__ method, even though, again, no coercion is needed:
Python 3.2 (r32:88452, Feb 20 2011, 10:19:59)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class X(str):
... def __str__(self):
... print("In __str__")
... return "*** " + self + " ***"
...
>>> x = X("abcde")
>>> print(x)
In __str__
*** abcde ***
>>> print(str(x))
In __str__
*** abcde *** |
|
Date |
User |
Action |
Args |
2011-04-21 19:22:53 | opstad | set | recipients:
+ opstad, r.david.murray |
2011-04-21 19:22:53 | opstad | set | messageid: <1303413773.93.0.253346402266.issue11900@psf.upfronthosting.co.za> |
2011-04-21 19:22:49 | opstad | link | issue11900 messages |
2011-04-21 19:22:49 | opstad | create | |
|