Issue #11388: Added a clear() method to MutableSequence

This commit is contained in:
Eli Bendersky 2011-03-04 05:34:58 +00:00
parent 1bc4f193d8
commit 9479d1ade8
2 changed files with 9 additions and 0 deletions

View File

@ -596,6 +596,13 @@ class MutableSequence(Sequence):
def append(self, value):
self.insert(len(self), value)
def clear(self):
try:
while True:
self.pop()
except IndexError:
pass
def reverse(self):
n = len(self)
for i in range(n//2):

View File

@ -140,6 +140,8 @@ Library
- Issue #10276: Fix the results of zlib.crc32() and zlib.adler32() on buffers
larger than 4GB. Patch by Nadeem Vawda.
- Issue #11388: Added a clear() method to MutableSequence
Build
-----