MCPcopy Index your code
hub / github.com/RustPython/RustPython / DoubleEq

Class DoubleEq

Lib/test/test_functools.py:2018–2027  ·  view source on GitHub ↗

Demonstrate a reentrant lru_cache call within a single thread

Source from the content-addressed store, hash-verified

2016 return x
2017
2018 class DoubleEq:
2019 'Demonstrate a reentrant lru_cache call within a single thread'
2020 def __init__(self, x):
2021 self.x = x
2022 def __hash__(self):
2023 return self.x
2024 def __eq__(self, other):
2025 if self.x == 2:
2026 test_func(DoubleEq(1))
2027 return self.x == other.x
2028
2029 test_func(DoubleEq(1)) # Load the cache
2030 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