summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-06-13 01:40:00 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-06-13 01:40:00 (GMT)
commit4afbba3d340655bb8be2a97b76fe689be7f0c013 (patch)
tree60357e254452ffe5f7256284a5858f5e6fb93ca2 /Lib
parentcb73bdac9565e7d4a9133635f802f446a915ca88 (diff)
downloadcpython-4afbba3d340655bb8be2a97b76fe689be7f0c013.zip
cpython-4afbba3d340655bb8be2a97b76fe689be7f0c013.tar.gz
cpython-4afbba3d340655bb8be2a97b76fe689be7f0c013.tar.bz2
keep the slice.step field as NULL if no step expression is given
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_ast.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 1674b97..eac42d3 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -146,6 +146,12 @@ class AST_Tests(unittest.TestCase):
self.assertEquals(to_tuple(ast_tree), o)
self._assert_order(ast_tree, (0, 0))
+ def test_slice(self):
+ slc = ast.parse("x[::]").body[0].value.slice
+ self.assertIsNone(slc.upper)
+ self.assertIsNone(slc.lower)
+ self.assertIsNone(slc.step)
+
def test_nodeclasses(self):
x = ast.BinOp(1, 2, 3, lineno=0)
self.assertEquals(x.left, 1)