mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Speed-up __iter__() mixin method.
This commit is contained in:
parent
0913166da2
commit
18a1ffcda3
1 changed files with 6 additions and 6 deletions
|
|
@ -496,13 +496,13 @@ class Sequence:
|
|||
|
||||
def __iter__(self):
|
||||
i = 0
|
||||
while True:
|
||||
try:
|
||||
try:
|
||||
while True:
|
||||
v = self[i]
|
||||
except IndexError:
|
||||
break
|
||||
yield v
|
||||
i += 1
|
||||
yield v
|
||||
i += 1
|
||||
except IndexError:
|
||||
return
|
||||
|
||||
def __contains__(self, value):
|
||||
for v in self:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue