We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent acb4c1c commit c5063d8Copy full SHA for c5063d8
test.py
@@ -647,8 +647,13 @@ def test_nogil():
647
def repeat(s: str, n: int) -> str:
648
return s * n
649
650
- assert foo("a", 3) == "aaa" and foo("a", 2) == "aa"
651
+ @ctu.cached(ctu.AutoPrefixedCache(cache))
+ def banged(s: str, n: int) -> str:
652
+ return repeat(s, n) + "!"
653
+
654
+ assert banged("a", 3) == "aaa!" # +2 entries
655
+ assert repeat("a", 3) == "aaa" # hit
656
+ assert banged("a", 3) == "aaa!" # hit
657
assert cache.hits() == 0.5
658
659
assert not sys._is_gil_enabled()
0 commit comments