MCPcopy Create free account
hub / github.com/python/cpython / test_merge_and_mutate

Method test_merge_and_mutate

Lib/test/test_set.py:1896–1908  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1894 list(si)
1895
1896 def test_merge_and_mutate(self):
1897 # gh-141805
1898 class X:
1899 def __hash__(self):
1900 return hash(0)
1901 def __eq__(self, o):
1902 other.clear()
1903 return False
1904
1905 other = set()
1906 other = {X() for i in range(10)}
1907 s = {0}
1908 s.update(other)
1909
1910 def test_hash_collision_concurrent_add(self):
1911 class X:

Callers

nothing calls this directly

Calls 3

setFunction · 0.85
XClass · 0.70
updateMethod · 0.45

Tested by

no test coverage detected