[Python-checkins] r88740 - in python/branches/py3k: Lib/collections/abc.py Misc/NEWS

eli.bendersky python-checkins at python.org
Fri Mar 4 06:34:59 CET 2011


Author: eli.bendersky
Date: Fri Mar 4 06:34:58 2011
New Revision: 88740
Log:
Issue #11388: Added a clear() method to MutableSequence
Modified:
 python/branches/py3k/Lib/collections/abc.py
 python/branches/py3k/Misc/NEWS
Modified: python/branches/py3k/Lib/collections/abc.py
==============================================================================
--- python/branches/py3k/Lib/collections/abc.py	(original)
+++ python/branches/py3k/Lib/collections/abc.py	Fri Mar 4 06:34:58 2011
@@ -596,6 +596,13 @@
 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):
Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Fri Mar 4 06:34:58 2011
@@ -140,6 +140,8 @@
 - 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
 -----
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /