sgzwiz / brython

Automatically exported from code.google.com/p/brython
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

List comprehesion issues #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using the console
# this  Work perfectly
print( [ i for i in range(100) if i <10 ])
# But this is KO: if ] is next to i, 0 is ignored in if <10 
print( [ i for i in range(100) if i <10])
# But this is ok
print( [ i for i in range(10)])

Results:
[0,1,2,3,4,5,6,7,8,9]
[0]
[0,1,2,3,4,5,6,7,8,9]
<done in 13 ms>

Code (for the wrong part):
$print($list_comp([["i","range(Number(100))"]],"i","i <1",['range',range]))

Original issue reported on code.google.com by jacob.ni...@gmail.com on 18 Jan 2013 at 9:13

GoogleCodeExporter commented 9 years ago

Original comment by pierre.q...@gmail.com on 26 Jan 2013 at 6:24

GoogleCodeExporter commented 9 years ago
fixed in rev 440 (condition string was missing the last character)

Original comment by pierre.q...@gmail.com on 26 Jan 2013 at 7:20