Hash() values #97

pyjsorg opened this Issue Apr 27, 2012 · 0 comments


None yet

1 participant

pyjsorg commented Apr 27, 2012

Python requires that hash() values should be

  1. of numeric type
  2. same for values coercible to numeric types, including
    >>> hash(True) == hash(1)
    >>> hash(False) == hash(0)

This affects set, dict and possibly other code, which relies on hash() values.
For example, in CPython:

>>> set([True, False, 1, 0])
set([False, True])

while in pyjs its set([True, False, 1, 0])

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=626 (July 01, 2011 08:16:55)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment