Fix a lot of list comprehensions.

This commit is contained in:
Dave Halter
2016-12-02 11:17:55 +01:00
parent dac372405e
commit 16a48a7a45
6 changed files with 70 additions and 33 deletions

View File

@@ -69,9 +69,17 @@ listen(['' for x in [1]])
# nested list comprehensions
# -----------------
b = [a for arr in [[1]] for a in arr]
b = [a for arr in [[1, 1.0]] for a in arr]
#? int()
b[0]
#? float()
b[1]
b = [arr for arr in [[1, 1.0]] for a in arr]
#? int()
b[0][0]
#? float()
b[1][1]
b = [a for arr in [[1]] if '' for a in arr if '']
#? int()
@@ -181,6 +189,8 @@ def x():
foo = [x for x in [1, '']][:1]
#? int()
foo[0]
#? str()
foo[1]
# -----------------
# In class