[Python-Dev] unicode hell/mixing str and unicode as dictionary keys

David Hopwood david.nospam.hopwood at blueyonder.co.uk
Mon Aug 7 23:34:10 CEST 2006


Michael Foord wrote:
> David Hopwood wrote:[snip..]
> 
>>>> 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.
>>
>> No; always considering Unicode and non-ASCII byte strings to be distinct
>> is just as logical.
> 
> Except there has been an implicit promise in Python for years now that
> ascii byte-strings will compare equally to the unicode equivalent: lots
> of code assumes this.

I think you must have misread my comment:

  No; always considering Unicode and *non-ASCII* byte strings to be distinct
  is just as logical.

This says nothing about comparing Unicode and ASCII byte strings.

-- 
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>




More information about the Python-Dev mailing list