aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/misc
diff options
context:
space:
mode:
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)