summaryrefslogtreecommitdiff
path: root/astroid/tree/scoped_nodes.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2016-04-26 16:13:11 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2016-04-26 16:39:23 +0300
commitf6fdedef1f9cafbfb48fb3c6b31ef51156b3802a (patch)
tree5ae7e0d85d7fbc752898f76979123fd0884e14a1 /astroid/tree/scoped_nodes.py
parent11e53a2608a5b34d3922a54963c0eab0e87ecb53 (diff)
downloadastroid-git-f6fdedef1f9cafbfb48fb3c6b31ef51156b3802a.tar.gz
Calling lambda methods (defined at class level) can be understood.
Diffstat (limited to 'astroid/tree/scoped_nodes.py')
-rw-r--r--astroid/tree/scoped_nodes.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/astroid/tree/scoped_nodes.py b/astroid/tree/scoped_nodes.py
index 9fe5e9c0..674de3d8 100644
--- a/astroid/tree/scoped_nodes.py
+++ b/astroid/tree/scoped_nodes.py
@@ -784,7 +784,12 @@ class Lambda(LambdaFunctionMixin, lookup.LocalsDictNode):
name = '<lambda>'
# function's type, 'function' | 'method' | 'staticmethod' | 'classmethod'
- type = 'function'
+ @property
+ def type(self):
+ if self.args.args and self.args.args[0].name == 'self':
+ if isinstance(self.parent.scope(), ClassDef):
+ return 'method'
+ return 'function'
def __init__(self, lineno=None, col_offset=None, parent=None):
self.args = []