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   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to