diff options
Diffstat (limited to 'astroid/util.py')
-rw-r--r-- | astroid/util.py | 12 |
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 |