the Slice in x[::] has to have step as None to help the interpreter

This commit is contained in:
Benjamin Peterson 2009-07-20 20:28:08 +00:00
parent a2514f4ce9
commit 4879c907ce
3 changed files with 17 additions and 5 deletions

View file

@ -150,7 +150,8 @@ class AST_Tests(unittest.TestCase):
slc = ast.parse("x[::]").body[0].value.slice
self.assertIsNone(slc.upper)
self.assertIsNone(slc.lower)
self.assertIsNone(slc.step)
self.assertTrue(isinstance(slc.step, ast.Name))
self.assertEqual(slc.step.id, "None")
def test_from_import(self):
im = ast.parse("from . import y").body[0]