MCPcopy Index your code
hub / github.com/python/cpython / DoubleEq

Class DoubleEq

Lib/test/test_functools.py:2049–2058  ·  view source on GitHub ↗

Demonstrate a reentrant lru_cache call within a single thread

Source from the content-addressed store, hash-verified

2047 return x
2048
2049 class DoubleEq:
2050 'Demonstrate a reentrant lru_cache call within a single thread'
2051 def __init__(self, x):
2052 self.x = x
2053 def __hash__(self):
2054 return self.x
2055 def __eq__(self, other):
2056 if self.x == 2:
2057 test_func(DoubleEq(1))
2058 return self.x == other.x
2059
2060 test_func(DoubleEq(1)) # Load the cache
2061 test_func(DoubleEq(2)) # Load the cache

Callers 2

__eq__Method · 0.85
test_need_for_rlockMethod · 0.85

Calls

no outgoing calls

Tested by 2

__eq__Method · 0.68
test_need_for_rlockMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…