Use chain.from_iterable in python.py

This commit is contained in:
Ram Rachum 2020-06-17 13:50:54 +03:00 committed by GitHub
parent ec98dabfab
commit 214da8e523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -334,10 +334,10 @@ class MutableChain:
"""
def __init__(self, *args):
self.data = chain(*args)
self.data = chain.from_iterable(args)
def extend(self, *iterables):
self.data = chain(self.data, *iterables)
self.data = chain(self.data, chain.from_iterable(iterables))
def __iter__(self):
return self