Commit eea8ce91 authored by Stefan Behnel's avatar Stefan Behnel

additional test case

parent dc54ee46
......@@ -105,6 +105,24 @@ def test_set_discard():
s1.discard(3)
return s1
def test_set_sideeffect_unhashable_failure():
"""
>>> test_set_sideeffect_unhashable_failure()
[2, 4, 5]
"""
L = []
def sideeffect(x):
L.append(x)
return x
def unhashable_value(x):
L.append(x)
return set()
try:
s = set([1,sideeffect(2),3,unhashable_value(4),sideeffect(5)])
except TypeError: pass
else: assert False, "expected exception not raised"
return L
def sorted(it):
# Py3 can't compare strings to ints
chars = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment