str(obj) not calling obj.__str__?
23 Feb
2020
23 Feb
'20
5:19 a.m.
Hello, I just noticed that calling `str(x)` is actually doing (in CPython `PyObject_Str`) `type(x).__str__(x)` rather than `x.__str__()`. Context: I wanted to override __str__ for certain objects in order to “see them better”. I'm wondering why not do `x.__str__()` Best regards, -- Jérôme
1513
Age (days ago)
1516
Last active (days ago)
4 comments
3 participants
participants (3)
-
Josh Rosenberg
-
Jérôme Carretero
-
Michael Foord