mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Fix crazier subscript operations
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user