This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ned.deily
Recipients Jackson.Cooper, benjamin.peterson, ned.deily
Date 2014-06-08.06:58:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1402210711.81.0.557607093119.issue21691@psf.upfronthosting.co.za>
In-reply-to
Content
To expand a bit, this is by design, a consequence of the hash randomization feature; see

https://docs.python.org/3/using/cmdline.html#envvar-PYTHONHASHSEED

As noted there, if necessary, it is possible to disable hash randomization.  But tests with set values or dict keys should not depend on a particular order as even disabling hash randomization would not guarantee the same results on different platforms or builds of Pythons.

$ python3.4 -c "print(set(['A', 'B']))"
{'B', 'A'}
$ python3.4 -c "print(set(['A', 'B']))"
{'A', 'B'}
$ python3.4 -c "print(set(['A', 'B']))"
{'B', 'A'}
$ PYTHONHASHSEED=0 python3.4 -c "print(set(['A', 'B']))"
{'B', 'A'}
$ PYTHONHASHSEED=0 python3.4 -c "print(set(['A', 'B']))"
{'B', 'A'}
$ PYTHONHASHSEED=0 python3.4 -c "print(set(['A', 'B']))"
{'B', 'A'}
History
Date User Action Args
2014-06-08 06:58:31ned.deilysetrecipients: + ned.deily, benjamin.peterson, Jackson.Cooper
2014-06-08 06:58:31ned.deilysetmessageid: <1402210711.81.0.557607093119.issue21691@psf.upfronthosting.co.za>
2014-06-08 06:58:31ned.deilylinkissue21691 messages
2014-06-08 06:58:31ned.deilycreate