Demonstrate a reentrant lru_cache call within a single thread
| 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 |
no outgoing calls