mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-16 10:37:52 +08:00
Fix lambda_nocond.
This commit is contained in:
@@ -103,6 +103,7 @@ class Parser(object):
|
|||||||
'comp_for': pt.CompFor,
|
'comp_for': pt.CompFor,
|
||||||
'decorator': pt.Decorator,
|
'decorator': pt.Decorator,
|
||||||
'lambdef': pt.Lambda,
|
'lambdef': pt.Lambda,
|
||||||
|
'lambdef_nocond': pt.Lambda,
|
||||||
}
|
}
|
||||||
|
|
||||||
self.global_names = []
|
self.global_names = []
|
||||||
|
|||||||
@@ -95,3 +95,12 @@ class Test(object):
|
|||||||
self.a
|
self.a
|
||||||
#? float()
|
#? float()
|
||||||
pred(1.0, 2)
|
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]
|
||||||
|
|||||||
Reference in New Issue
Block a user