Skip to content

Stop comparing repr()'s in TestEntryPoint#533

Merged
jaraco merged 1 commit into
pypa:masterfrom
s-t-e-v-e-n-k:compare-ep-attributes
Apr 7, 2016
Merged

Stop comparing repr()'s in TestEntryPoint#533
jaraco merged 1 commit into
pypa:masterfrom
s-t-e-v-e-n-k:compare-ep-attributes

Conversation

@s-t-e-v-e-n-k

Copy link
Copy Markdown
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

jaraco commented Apr 7, 2016

Copy link
Copy Markdown
Member

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.

2 participants