[Python-Dev] unicode inconsistency? (original) (raw)
Neil Schemenauer nas at arctrix.com
Thu Sep 9 20:50:35 CEST 2004
- Previous message: [Python-Dev] unicode inconsistency?
- Next message: [Python-Dev] unicode inconsistency?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Sep 09, 2004 at 02:09:56PM -0400, Aahz wrote:
Check the recent python-dev archives for a long and nauseating thread about interactions between str and unicode.
Using unicode doesn't help. The core problem is that you cannot create a class that behaves like 'unicode' in this operation without subclassing from 'unicode'. That violates the "duck typing" design principle of Python. We violate it other places, usually in the name of efficiency, but I see no good reason in this case.
I suspect the fix will be pretty straight forward (call tp_str and if the result is 'unicode' the produce a 'unicode' string). Again, is there some reason why we don't want this behavior?
Neil
- Previous message: [Python-Dev] unicode inconsistency?
- Next message: [Python-Dev] unicode inconsistency?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]