diff options
author | Sann Yay Aye | 2020-01-30 12:57:51 +0530 |
---|---|---|
committer | Sann Yay Aye | 2020-01-30 12:57:51 +0530 |
commit | 190966e010e321e4df56d40104ec80467a870e53 (patch) | |
tree | f97ac913ec59a975ad64d5a3cd61e11923d98a69 /venv/Lib/site-packages/lazy_object_proxy/utils.py | |
parent | 7ecaa6f103b2755dc3bb3fae10a0d7ab28162596 (diff) | |
download | Chemical-Simulator-GUI-190966e010e321e4df56d40104ec80467a870e53.tar.gz Chemical-Simulator-GUI-190966e010e321e4df56d40104ec80467a870e53.tar.bz2 Chemical-Simulator-GUI-190966e010e321e4df56d40104ec80467a870e53.zip |
undo&redo_implementation
Diffstat (limited to 'venv/Lib/site-packages/lazy_object_proxy/utils.py')
-rw-r--r-- | venv/Lib/site-packages/lazy_object_proxy/utils.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/venv/Lib/site-packages/lazy_object_proxy/utils.py b/venv/Lib/site-packages/lazy_object_proxy/utils.py new file mode 100644 index 0000000..ceb3050 --- /dev/null +++ b/venv/Lib/site-packages/lazy_object_proxy/utils.py @@ -0,0 +1,13 @@ +def identity(obj): + return obj + + +class cached_property(object): + def __init__(self, func): + self.func = func + + def __get__(self, obj, cls): + if obj is None: + return self + value = obj.__dict__[self.func.__name__] = self.func(obj) + return value |