diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-10 15:21:50 -0800 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-10 15:21:50 -0800 |
commit | ad97f2a49ea723cf21f828c99e0075ff1fd0680a (patch) | |
tree | 8730aa8abb6b1bdd77b6e6a1be963ceee34503ef /tests/basics | |
parent | e9b4b7ac756273ca14507efc6d92c8b003f99c51 (diff) | |
parent | 899c69f94c4a776a41c66129a93c4db52535d73d (diff) | |
download | micropython-ad97f2a49ea723cf21f828c99e0075ff1fd0680a.tar.gz micropython-ad97f2a49ea723cf21f828c99e0075ff1fd0680a.zip |
Merge pull request #136 from pfalcon/for-range-downto
compile_for_stmt_optimised_range(): Properly handle negative & unknown s...
Diffstat (limited to 'tests/basics')
-rw-r--r-- | tests/basics/tests/for1.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/basics/tests/for1.py b/tests/basics/tests/for1.py index 5a2635638d..c6199416cd 100644 --- a/tests/basics/tests/for1.py +++ b/tests/basics/tests/for1.py @@ -7,3 +7,13 @@ def f(): print(x, y, z) f() + +# range with negative step +for i in range(3, -1, -1): + print(i) + +a = -1 +# range with non-constant step - we optimize constant steps, so this +# will be executed differently +for i in range(3, -1, a): + print(i) |