summaryrefslogtreecommitdiff
path: root/astroid/arguments.py
diff options
context:
space:
mode:
Diffstat (limited to 'astroid/arguments.py')
-rw-r--r--astroid/arguments.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/astroid/arguments.py b/astroid/arguments.py
index a0ffe73..e4776ec 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)