summaryrefslogtreecommitdiff
path: root/PyEmb.py
diff options
context:
space:
mode:
Diffstat (limited to 'PyEmb.py')
-rw-r--r--PyEmb.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/PyEmb.py b/PyEmb.py
index a8f01248..80b9a8a5 100644
--- a/PyEmb.py
+++ b/PyEmb.py
@@ -5,6 +5,14 @@ import math
import sys
from copy import deepcopy
+try:
+ from functools import lru_cache
+except ImportError:
+ from backports.functools_lru_cache import lru_cache
+
+# simplify use of lru_cache decorator
+def cache(*args, **kwargs):
+ return lru_cache(maxsize=None)(*args, **kwargs)
class Point: