0

If you have a fediverse account, you can quote this note from your own instance. Search https://hachyderm.io/users/nedbat/statuses/115758611283655705 on your instance and quote it. (Note that quoting is not supported in Mastodon.)

RE: hachyderm.io/@nedbat/115758611

I also got to use this Python oddity for real in a test suite:
github.com/coveragepy/coverage

# Make two sets which are equal but iterate differently.
numset1 = set(range(20))
numset2 = set(range(20))
for i in range(0, 20, 2):
numset2.remove(i)
for i in range(0, 20, 2):
numset2.add(i)

def test_scrambled_sets():
assert numset1 == numset2
assert list(numset1) != list(numset2)

0