1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-04 02:50:05 +08:00
SpaceVim/bundle/jedi-vim/pythonx/jedi/test/completion/named_expression.py
2022-10-23 15:41:52 +08:00

53 lines
689 B
Python
Vendored

# For assignment expressions / named expressions / walrus operators / whatever
# they are called.
# python >= 3.8
b = (a:=1, a)
#? int()
b[0]
#?
b[1]
# Should not fail
b = ('':=1,)
#? int()
b[0]
def test_assignments():
match = ''
#? str()
match
#? 8 int()
if match := 1:
#? int()
match
#? int()
match
def test_assignments2():
class Foo:
match = ''
#? str()
Foo.match
#? 13 int()
if Foo.match := 1:
#? str()
Foo.match
#? str()
Foo.match
#?
y
#? 16 str()
if y := Foo.match:
#? str()
y
#? str()
y
#? 8 str()
if z := Foo.match:
pass