mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
list() builtin is working better now
This commit is contained in:
@@ -937,7 +937,8 @@ def get_scopes_for_name(scope, name_str, position=None, search_global=False):
|
||||
and scope.var == name.parent.parent:
|
||||
name = InstanceElement(scope.instance, name)
|
||||
par = name.parent
|
||||
if isinstance(par, parsing.Flow):
|
||||
if isinstance(par, parsing.Flow) or isinstance(par,
|
||||
InstanceElement) and isinstance(par.var, parsing.Flow) :
|
||||
if par.command == 'for':
|
||||
# Take the first statement (for has always only
|
||||
# one, remember `in`). And follow it. After that,
|
||||
|
||||
@@ -187,7 +187,7 @@ GetItem("")[1]
|
||||
# conversions
|
||||
# -----------------
|
||||
|
||||
#? str()
|
||||
#? int() str()
|
||||
list([1,""])[1]
|
||||
|
||||
#? str()
|
||||
|
||||
@@ -24,6 +24,21 @@ for a4, (b4, c4) in (1,("", list)), (1,("", list)):
|
||||
#? list
|
||||
c4
|
||||
|
||||
a = []
|
||||
for i in [1,'']:
|
||||
a += [i]
|
||||
|
||||
#? int() str()
|
||||
a[0]
|
||||
|
||||
a = []
|
||||
b = [1.0,'']
|
||||
for i in b:
|
||||
a += [i]
|
||||
|
||||
#? float() str()
|
||||
a[0]
|
||||
|
||||
# -----------------
|
||||
# list comprehensions
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user