Mike Krell wrote: > Is this a bug? If not, how do I override __str__ on a unicode derived class? Based on the behaviour of str and the fact that overriding unicode.__repr__ works just fine, I'd say file a bug on SF. I think this bit in PyUnicode_Format needs to use PyUnicode_CheckExact instead of PyUnicode_Check: case 's': case 'r': if (PyUnicode_Check(v) && c == 's') { The corresponding code in PyString_Format makes a call to _PyObject_Str which deals with subclasses correctly. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4