[Python-Dev] unicode hell/mixing str and unicode as dictionary keys (original) (raw)

Michael Foord fuzzyman at voidspace.org.uk
Mon Aug 7 15:22:24 CEST 2006


Martin v. Löwis wrote:

[snip..] Expanding this view to Unicode should mean that a unicode string U equals a byte string B if U.encode(systemencode) == B or B.decode(systemencoding) == U, and that they don't equal otherwise (e.g. if the conversion fails with a "not convertible" exception). Which of the two conversions is selected is arbitrary; we should, of course, continue to use the one we always used (for "ascii", there is no difference between the two).

+1

This seems the most (only ?) logical solution.

Michael Foord

Regards, Martin


Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk



More information about the Python-Dev mailing list