Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop comparing repr()'s in TestEntryPoint #533

Merged
merged 1 commit into from Apr 7, 2016
Merged

Stop comparing repr()'s in TestEntryPoint #533

merged 1 commit into from Apr 7, 2016

Conversation

s-t-e-v-e-n-k
Copy link
Contributor

In Python 3, the default order of iterables can not determined,
so comparing the repr of objects that include tuples is not static
like it is under Python 2. Compare the attributes of EntryPoint
instead, making sure to sort .attrs and .extras.

Closes: #526

In Python 3, the default order of iterables can not determined,
so comparing the repr of objects that include tuples is not static
like it is under Python 2. Compare the attributes of EntryPoint
instead, making sure to sort .attrs and .extras.

Closes: #526
@jaraco
Copy link
Member

jaraco commented Apr 7, 2016

Fantastic. Thanks!

One clarification - tuples and lists are ordered and will always have consistent order, but on late versions of Python, it's possible that ordering of items in identical sets is not stable, depending on the PYTHONHASHSEED:

$ PYTHONHASHSEED=3 python3.5 -c "print(list({'extra1', 'extra2'}) == list({'extra2', 'extra1'}))"
False
$ PYTHONHASHSEED=0 python3.5 -c "print(list({'extra1', 'extra2'}) == list({'extra2', 'extra1'}))"
True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants