diff options
author | Marcel Bargull <marcel.bargull@udo.edu> | 2018-03-17 00:00:56 +0100 |
---|---|---|
committer | Marcel Bargull <marcel.bargull@udo.edu> | 2018-03-17 00:00:56 +0100 |
commit | 5cc97a07737bf08ccce187e04026002e62ce977f (patch) | |
tree | 9002324d5221efe7ee33ffee878514eb77b6005f /util.py | |
parent | 889ed48b4046dd187107a081cd07e00e9c8633f0 (diff) | |
download | ruamel.yaml-5cc97a07737bf08ccce187e04026002e62ce977f.tar.gz |
add doc string for util.LazyEval
Diffstat (limited to 'util.py')
-rw-r--r-- | util.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -17,6 +17,15 @@ if False: # MYPY class LazyEval(object): + """ + Lightweight wrapper around lazily evaluated func(*args, **kwargs). + + func is only evaluated when any attribute of its return value is accessed. + Every attribute access is passed through to the wrapped value. + (This only excludes special cases like method-wrappers, e.g., __hash__.) + The sole additional attribute is the lazy_self function which holds the + return value (or, prior to evaluation, func and arguments), in its closure. + """ def __init__(self, func, *args, **kwargs): def lazy_self(): return_value = func(*args, **kwargs) |