summaryrefslogtreecommitdiff
path: root/logilab/common/modutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'logilab/common/modutils.py')
-rw-r--r--logilab/common/modutils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/logilab/common/modutils.py b/logilab/common/modutils.py
index 34419bd..868dfa0 100644
--- a/logilab/common/modutils.py
+++ b/logilab/common/modutils.py
@@ -79,6 +79,17 @@ class NoSourceFile(Exception):
"""
class LazyObject(object):
+ """
+ This class allows to lazyly declare a object (most likely only a callable
+ according to the code) from a module without importing it.
+
+ The import will be triggered when the user tries to access attributes of
+ the object/callable or call it.
+
+ Trying to set or delete attributes of the wrapped object/callable will not
+ works as expected.
+ """
+
def __init__(self, module, obj):
self.module = module
self.obj = obj