diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2014-04-13 11:50:59 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2014-04-13 11:50:59 +0300 |
commit | 4e92fa523f75143070ccb704e62d82fb4fcba23c (patch) | |
tree | f902c0a932540742eda48b7fbf75b8bdc945b139 /inference.py | |
parent | 9781343aa75f6425b4ea68ea9eb149770160dfba (diff) | |
download | astroid-git-4e92fa523f75143070ccb704e62d82fb4fcba23c.tar.gz |
Fix argument search for methods and classmethods.
--HG--
branch : args_fix
Diffstat (limited to 'inference.py')
-rw-r--r-- | inference.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/inference.py b/inference.py index 29c97be5..35cce332 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) |