Files
python-uncompyle6/test/simple_source/slice/02_slice.py
2019-04-10 11:49:27 -04:00

16 lines
230 B
Python

# Self-checking test.
# Tests of Python slice operators
ary = [1,2,3,4,5]
# Forces BUILD_SLICE 2 on 3.x
a = ary[:2]
assert a == [1, 2]
a = ary[2:]
assert a == [3, 4, 5]
# Forces BUILD_SLICE 3
a = ary[1:4:2]
assert a == [2, 4]