diff options
| author | J08nY | 2025-03-13 19:38:48 +0100 |
|---|---|---|
| committer | J08nY | 2025-03-13 19:38:48 +0100 |
| commit | 7c2f12a0111de33330870b2179b71281b59ada29 (patch) | |
| tree | 80beb7f4e3090a4805d7aa20ffba5cbcc0078902 /pyecsca/misc/cache.py | |
| parent | eccc58127b4c0c10f50e4d05e699d3585391e8a1 (diff) | |
| download | pyecsca-7c2f12a0111de33330870b2179b71281b59ada29.tar.gz pyecsca-7c2f12a0111de33330870b2179b71281b59ada29.tar.zst pyecsca-7c2f12a0111de33330870b2179b71281b59ada29.zip | |
Diffstat (limited to 'pyecsca/misc/cache.py')
| -rw-r--r-- | pyecsca/misc/cache.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/pyecsca/misc/cache.py b/pyecsca/misc/cache.py index 5f388ad..acde6bf 100644 --- a/pyecsca/misc/cache.py +++ b/pyecsca/misc/cache.py @@ -1,4 +1,5 @@ """Cache some things.""" + from functools import lru_cache from sympy import sympify as _orig_sympify, simplify as _orig_simplify, count_ops from public import public @@ -14,5 +15,21 @@ def sympify( @public @lru_cache(maxsize=256, typed=True) -def simplify(expr, ratio=1.7, measure=count_ops, rational=False, inverse=False, doit=True, **kwargs): - return _orig_simplify(expr, ratio=ratio, measure=measure, rational=rational, inverse=inverse, doit=doit, **kwargs) +def simplify( + expr, + ratio=1.7, + measure=count_ops, + rational=False, + inverse=False, + doit=True, + **kwargs, +): + return _orig_simplify( + expr, + ratio=ratio, + measure=measure, + rational=rational, + inverse=inverse, + doit=doit, + **kwargs, + ) |
