Author arigo
Recipients arigo
Date 2017-02-11.15:16:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1486826213.38.0.893503150194.issue29535@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation on the hash randomization says that date, time and datetime have a hash based on strings, that is therefore nondeterministic in several runs of Python.  I may either be missing a caveat, or the actual implementation does not follow its promise in case a timezone is attached to the datetime or time object:

~/svn/python/3.7-debug/python -c "import datetime;print(hash(d                      atetime.datetime(2016,10,10,0,0,0,0,datetime.timezone(datetime.timedelta(0, 36000)))))"
(this gives -6021186165085109055 all the time)

~/svn/python/3.7-debug/python -c "import datetime;print(hash(datetime.time(0,0,0,0, datetime.timezone(datetime.timedelta(0, 36000)))))"
(this gives -3850122659820237607 all the time)
History
Date User Action Args
2017-02-11 15:16:53arigosetrecipients: + arigo
2017-02-11 15:16:53arigosetmessageid: <1486826213.38.0.893503150194.issue29535@psf.upfronthosting.co.za>
2017-02-11 15:16:53arigolinkissue29535 messages
2017-02-11 15:16:52arigocreate