diff --git a/jedi/parser/__init__.py b/jedi/parser/__init__.py index 9d7706e3..45bace33 100644 --- a/jedi/parser/__init__.py +++ b/jedi/parser/__init__.py @@ -103,6 +103,7 @@ class Parser(object): 'comp_for': pt.CompFor, 'decorator': pt.Decorator, 'lambdef': pt.Lambda, + 'lambdef_nocond': pt.Lambda, } self.global_names = [] diff --git a/test/completion/lambdas.py b/test/completion/lambdas.py index 06b121e5..d7391691 100644 --- a/test/completion/lambdas.py +++ b/test/completion/lambdas.py @@ -95,3 +95,12 @@ class Test(object): self.a #? float() pred(1.0, 2) + +# ----------------- +# test_nocond in grammar (happens in list comprehensions with `if`) +# ----------------- +# Doesn't need to do anything yet. It should just not raise an error. These +# nocond lambdas make no sense at all. + +#? int() +[a for a in [1,2] if lambda: 3][0]