mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-13 09:48:55 +08:00
Don't use a while loop in py__iter__
This commit is contained in:
1 parent
3c201cc36c
commit
e3d5ee8332
1 file changed
+1
-2
@@ -313,8 +313,7 @@ class Tuple(_ContainerBase):
|
|||||||
|
|
||||||
def py__iter__(self, contextualized_node=None):
|
def py__iter__(self, contextualized_node=None):
|
||||||
if self._is_homogenous():
|
if self._is_homogenous():
|
||||||
while True:
|
yield LazyKnownContexts(self._get_getitem_contexts(0).execute_annotation())
|
||||||
yield LazyKnownContexts(self._get_getitem_contexts(0).execute_annotation())
|
|
||||||
else:
|
else:
|
||||||
if isinstance(self._index_context, SequenceLiteralContext):
|
if isinstance(self._index_context, SequenceLiteralContext):
|
||||||
for i in range(self._index_context.py__len__()):
|
for i in range(self._index_context.py__len__()):
|
||||||
|
|||||||
Reference in new issue
Block a user