Skip to content

Commit 1e24775

Browse files
committed
Bump version
1 parent 563cb57 commit 1e24775

3 files changed

Lines changed: 42 additions & 2 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cachebox"
3-
version = "6.1.0"
3+
version = "6.1.1"
44
edition = "2021"
55
description = "The fastest memoizing and caching Python library written in Rust"
66
readme = "README.md"

a.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# from cachebox import Test
2+
# import sys
3+
4+
# sys.setrecursionlimit(8)
5+
6+
# cache = Test()
7+
8+
# def should_raise_recursive_error(key):
9+
# try:
10+
# cache[key]
11+
# except KeyError:
12+
# pass
13+
14+
# return should_raise_recursive_error(key)
15+
16+
# should_raise_recursive_error("same-key")
17+
18+
19+
from cachebox import TTLCache, cached
20+
21+
22+
def key(a, b, c, exception: bool):
23+
return f"{a},{b},{c}"
24+
25+
26+
@cached(TTLCache(1024, 1), key_maker=key)
27+
def calc(a, b, c, exception: bool):
28+
if exception:
29+
raise Exception("first call")
30+
31+
return a + b + c
32+
33+
34+
try:
35+
calc(1, 2, 3, exception=True)
36+
except Exception:
37+
print("raised")
38+
39+
40+
calc(1, 2, 3, exception=False)

0 commit comments

Comments
 (0)