mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-34427: Fix infinite loop when calling MutableSequence.extend() on self (GH-8813)
This commit is contained in:
parent
e6dac00779
commit
1b5f9c9653
3 changed files with 15 additions and 0 deletions
|
|
@ -986,6 +986,8 @@ class MutableSequence(Sequence):
|
|||
|
||||
def extend(self, values):
|
||||
'S.extend(iterable) -- extend sequence by appending elements from the iterable'
|
||||
if values is self:
|
||||
values = list(values)
|
||||
for v in values:
|
||||
self.append(v)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue