Fix crazier subscript operations

This commit is contained in:
Dave Halter
2019-05-28 10:20:06 +02:00
parent b39928188f
commit 0cc7ea9bc9
2 changed files with 14 additions and 2 deletions

View File

@@ -356,8 +356,12 @@ class SequenceLiteralContext(Sequence):
yield LazyKnownContexts(types)
else:
for node in self.get_tree_entries():
yield LazyTreeContext(self._defining_context, node)
if node == ':' or node.type == 'subscript':
# TODO this should probably use at least part of the code
# of eval_subscript_list.
yield LazyKnownContext(Slice(self._defining_context, None, None, None))
else:
yield LazyTreeContext(self._defining_context, node)
for addition in check_array_additions(self._defining_context, self):
yield addition

View File

@@ -47,6 +47,14 @@ b[:]
#? int()
b[:, 1]
#? int()
b[:1, 1]
#? int()
b[1:1, 1]
#? int()
b[1:1:, ...]
#? int()
b[1:1:5, ...]
class _StrangeSlice():
def __getitem__(self, sliced):