mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
the Slice in x[::] has to have step as None to help the interpreter
This commit is contained in:
parent
a2514f4ce9
commit
4879c907ce
3 changed files with 17 additions and 5 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue