Commit b67d841c authored by Stefan Behnel's avatar Stefan Behnel

moved new listcomp test over to existing test module for list comprehensions

parent 31eebced
def foo():
"""
>>> foo()
[[], [-1], [-1, 0], [-1, 0, 1]]
"""
result = [[a-1 for a in range(b)] for b in range(4)]
return result
...@@ -55,3 +55,11 @@ def global_listcomp(): ...@@ -55,3 +55,11 @@ def global_listcomp():
>>> listcomp_result >>> listcomp_result
[0, 1, 4, 9, 16] [0, 1, 4, 9, 16]
""" """
def nested_result():
"""
>>> nested_result()
[[], [-1], [-1, 0], [-1, 0, 1]]
"""
result = [[a-1 for a in range(b)] for b in range(4)]
return result
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment