aboutsummaryrefslogtreecommitdiff
path: root/pyecsca/misc
diff options
context:
space:
mode:
authorJ08nY2023-10-06 22:45:12 +0200
committerJ08nY2023-10-06 22:45:12 +0200
commit0e300b7b532d1796fc2dbea6f09e326b856f866a (patch)
tree451571fbf08d29aa3d15bb55f25815c676bd4d4c /pyecsca/misc
parent3f89136bfdd0bbfa5efe0c7e75d2fb587bc79e32 (diff)
downloadpyecsca-0e300b7b532d1796fc2dbea6f09e326b856f866a.tar.gz
pyecsca-0e300b7b532d1796fc2dbea6f09e326b856f866a.tar.zst
pyecsca-0e300b7b532d1796fc2dbea6f09e326b856f866a.zip
Diffstat (limited to 'pyecsca/misc')
-rw-r--r--pyecsca/misc/cache.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pyecsca/misc/cache.py b/pyecsca/misc/cache.py
new file mode 100644
index 0000000..385ff4b
--- /dev/null
+++ b/pyecsca/misc/cache.py
@@ -0,0 +1,12 @@
+"""Cache some things."""
+from functools import lru_cache
+from sympy import sympify as _orig_sympify
+from public import public
+
+
+@public
+@lru_cache(maxsize=256, typed=True)
+def sympify(
+ a, locals=None, convert_xor=True, strict=False, rational=False, evaluate=None
+):
+ return _orig_sympify(a, locals, convert_xor, strict, rational, evaluate)