New submission from ardabro:

built-in hash() function cannot be effectively used for integers due to 
weird behavior for -1 argument:

>>> hash(0)
0
>>> hash(-1)
-2                # !!!!!
>>> hash(-2)
-2
>>> hash(-3)
-3
>>>

----------
components: Library (Lib)
messages: 231932
nosy: ardabro
priority: normal
severity: normal
status: open
title: hash() function gives the same result for -1 and for -2 argument (==-2)
type: behavior
versions: Python 2.7, Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22973>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to