A first very incomplete implementation of named expression support

This commit is contained in:
Dave Halter
2019-06-03 00:11:41 +02:00
parent 30526c564e
commit c8d658e452
2 changed files with 15 additions and 0 deletions

View File

@@ -142,6 +142,8 @@ def eval_node(context, element):
# Generator.send() is not implemented.
return NO_CONTEXTS
elif typ == 'namedexpr_test':
return eval_node(context, element.children[2])
else:
return eval_or_test(context, element)

View File

@@ -0,0 +1,13 @@
# python >= 3.8
b = (a:=1, a)
#? int()
b[0]
#?
b[1]
# Should not fail
b = ('':=1,)
#? int()
b[0]