diff options
Diffstat (limited to 'astroid/tree/scoped_nodes.py')
-rw-r--r-- | astroid/tree/scoped_nodes.py | 7 |
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 = [] |