mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-24 14:21:25 +08:00
More tests and better understanding of if/try branches name resolution.
This commit is contained in:
@@ -1,3 +1,39 @@
|
||||
# -----------------
|
||||
# First a few name resolution things
|
||||
# -----------------
|
||||
|
||||
x = 3
|
||||
if NOT_DEFINED:
|
||||
x = ''
|
||||
#? 6 int()
|
||||
elif x:
|
||||
pass
|
||||
else:
|
||||
#? int()
|
||||
x
|
||||
|
||||
x = 1
|
||||
try:
|
||||
x = ''
|
||||
#? 8 int() str()
|
||||
except x:
|
||||
#? 5 int() str()
|
||||
x
|
||||
x = 1.0
|
||||
else:
|
||||
#? 5 int() str()
|
||||
x
|
||||
x = list
|
||||
finally:
|
||||
#? 5 int() str() float() list
|
||||
x
|
||||
x = tuple
|
||||
|
||||
|
||||
# -----------------
|
||||
# Return checks
|
||||
# -----------------
|
||||
|
||||
def foo(x):
|
||||
if 1.0:
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user