[issue7890] equal unicode/str objects can have unequal hash

2010-02-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: lplatypus wrote: > > lplatypus added the comment: > > Okay thanks, but in that case might I suggest that this limitation be > mentioned in the documentation for sys.setdefaultencoding? It currently > reads as if any available encoding is acceptable. Pe

[issue7890] equal unicode/str objects can have unequal hash

2010-02-09 Thread lplatypus
lplatypus added the comment: Okay thanks, but in that case might I suggest that this limitation be mentioned in the documentation for sys.setdefaultencoding? It currently reads as if any available encoding is acceptable. Perhaps even a warning or exception should be produced when calling it

[issue7890] equal unicode/str objects can have unequal hash

2010-02-08 Thread Martin v . Löwis
Martin v. Löwis added the comment: This is not a bug in Python, but in your code. sys.setdefaultencoding is only supported when setting the default encoding to either latin-1, or ascii, or 'undefined'. Setting it to any other value will have undesirable consequences like the one you report. L

[issue7890] equal unicode/str objects can have unequal hash

2010-02-08 Thread lplatypus
New submission from lplatypus : The documentation for the hash() function says: "Numeric values that compare equal have the same hash value (even if they are of different types, as is the case for 1 and 1.0)" This can be violated when comparing a unicode object with its str equivalent. Here i