def f(i): d = r_dict(strange_key_eq, strange_key_hash) h = strange_key_hash("abc") assert h == strange_key_hash("aXX") and strange_key_eq("abc", "aXX") setitem_with_hash(d, "abc", h, i) assert getitem_with_hash(d, "aXX", h) == i try: getitem_with_hash(d, "bYY", strange_key_hash("bYY")) except KeyError: pass else: raise AssertionError return 0
def f(i): d = r_dict(strange_key_eq, strange_key_hash) h = strange_key_hash("abc") assert h == strange_key_hash("aXX") and strange_key_eq("abc", "aXX") setitem_with_hash(d, "abc", h, i) assert getitem_with_hash(d, "aXX", h) == i try: getitem_with_hash(d, "bYY", strange_key_hash("bYY")) except KeyError: pass else: raise AssertionError return 0
def f(i): d = {i + .5: 42, i + .6: -612} return getitem_with_hash(d, i + .5, compute_hash(i + .5))
def f(i): d = {i + .5: 42, i + .6: -612} return getitem_with_hash(d, i + .5, compute_hash(i + .5))