summaryrefslogtreecommitdiff
path: root/inference.py
diff options
context:
space:
mode:
Diffstat (limited to 'inference.py')
-rw-r--r--inference.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/inference.py b/inference.py
index 29c97be..35cce33 100644
--- a/inference.py
+++ b/inference.py
@@ -72,6 +72,11 @@ class CallContext:
return iter((boundnode,))
if funcnode.type == 'classmethod':
return iter((boundnode,))
+ # if we have a method, extract one position
+ # from the index, so we'll take in account
+ # the extra parameter represented by `self` or `cls`
+ if funcnode.type in ('method', 'classmethod'):
+ argindex -= 1
# 2. search arg index
try:
return self.args[argindex].infer(context)