[Python-Dev] Re: \ud800 crashes interpreter (PR#384)

Ka-Ping Yee ping@lfw.org
Tue, 4 Jul 2000 14:40:21 -0700 (PDT)


On Tue, 4 Jul 2000, M.-A. Lemburg wrote:
> 
> The reasoning at the time was that dictionaries should accept
> Unicode objects as keys which match their string equivalents
> as the same key, e.g. 'abc' works just as well as u'abc'.
[...]
> According to the docs, objects comparing equal should have the
> same hash value, yet this would require the hash value to be
> calculated using the default encoding and that
> would not only cause huge performance problems, but could
> effectively render Unicode useless,

Given the new 7-bit-ASCII-as-default-encoding-for-8-bit-strings
convention, shouldn't just hashing the character values work
fine?  That is, hash('abc') should == hash(u'abc'), no conversion
required.


-- ?!ng