summaryrefslogtreecommitdiff
path: root/astroid/util.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-11-01 13:19:04 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2015-11-01 13:19:04 +0200
commitc58048979bccf7f2c359968f54b77cbcf3679662 (patch)
treecf89fe23dd9a06e21168f771804186341bbfb487 /astroid/util.py
parent23c54fd64149b03d94c0ed6ccb7ce21fb620820d (diff)
downloadastroid-git-c58048979bccf7f2c359968f54b77cbcf3679662.tar.gz
Start splitting AST from runtime objects
There are two new directories now, runtime and tree, which are meant to separate between runtime objects, such as Instance, BoundMethod etc from AST nodes.
Diffstat (limited to 'astroid/util.py')
-rw-r--r--astroid/util.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/astroid/util.py b/astroid/util.py
index 20c44d72..7bef8809 100644
--- a/astroid/util.py
+++ b/astroid/util.py
@@ -66,3 +66,15 @@ def proxy_alias(alias_name, node_type):
{'__class__': object.__dict__['__class__'],
'__instancecheck__': _instancecheck})
return proxy(lambda: node_type)
+
+
+def register_implementation(base):
+ """Register an implementation for the given *base*
+
+ The given base class is expected to have a `register` method,
+ similar to what `abc.ABCMeta` provides when used.
+ """
+ def wrapped(impl):
+ base.register(impl)
+ return impl
+ return wrapped