list() builtin is working better now

This commit is contained in:
David Halter
2012-08-06 21:26:05 +02:00
parent 6ae98ba2f6
commit bef8fca57d
3 changed files with 18 additions and 2 deletions

View File

@@ -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,

View File

@@ -187,7 +187,7 @@ GetItem("")[1]
# conversions
# -----------------
#? str()
#? int() str()
list([1,""])[1]
#? str()

View File

@@ -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
# -----------------