By default, the __hash__() values of str, bytes and datetime objects are “salted” with an unpredictable random value. Although they remain constant within an individual Python process, they are not predictable between repeated invocations of Python.
This ruins reading and writing of databases; we should remove this functionality. I think cdb files created with Python 2 on different platforms (e.g. 32-bit or ARM) would have a similar issue.
Notes:
It's OK to allow for custom hash functions; we should add a test that shows this in action (maybe with a fast hash like adler32)
But we shouldn't provide a method to use the built-in hash() in python-pure-cdbmake
And we should remove the tests that use built-in hash()
As of Python 3.3:
This ruins reading and writing of databases; we should remove this functionality. I think
cdb
files created with Python 2 on different platforms (e.g. 32-bit or ARM) would have a similar issue.Notes:
hash()
in python-pure-cdbmakehash()