diff options
author | Ceridwen <ceridwenv@gmail.com> | 2015-11-06 17:58:34 -0500 |
---|---|---|
committer | Ceridwen <ceridwenv@gmail.com> | 2015-11-06 17:58:34 -0500 |
commit | 2f88b3eb44b6e895f45dd45c709e29a8f365e04f (patch) | |
tree | 07cc8d156eb7b72caca057ef32c3de721cd2a71c /astroid/arguments.py | |
parent | 3ca0c7580187913bec11d0042a36906a2af36c91 (diff) | |
parent | 86263c86c07cb47337a2f15174844fb60ed4d2d3 (diff) | |
download | astroid-git-2f88b3eb44b6e895f45dd45c709e29a8f365e04f.tar.gz |
Merge upstream
Diffstat (limited to 'astroid/arguments.py')
-rw-r--r-- | astroid/arguments.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/astroid/arguments.py b/astroid/arguments.py index a0ffe739..e4776ec5 100644 --- a/astroid/arguments.py +++ b/astroid/arguments.py @@ -183,6 +183,16 @@ class CallSite(object): else: # XXX can do better ? boundnode = funcnode.parent.frame() + + if isinstance(boundnode, nodes.ClassDef): + # Verify that we're accessing a method + # of the metaclass through a class, as in + # `cls.metaclass_method`. In this case, the + # first argument is always the class. + method_scope = funcnode.parent.scope() + if method_scope is boundnode.metaclass(): + return iter((boundnode, )) + if funcnode.type == 'method': if not isinstance(boundnode, bases.Instance): boundnode = bases.Instance(boundnode) |