This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Implement MutableSequence.clear()
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eli.bendersky Nosy List: daniel.urban, eli.bendersky, georg.brandl, ncoghlan, r.david.murray, rhettinger, stutzbach, terry.reedy
Priority: normal Keywords: easy

Created on 2011-03-03 18:36 by eli.bendersky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (8)
msg129994 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-03-03 18:36
Now that both list and bytearray support the clear() method (see issue #10516), MutableSequence.clear() has to be implemented.

This is pending on commit for issue #11386, which fixes the exception thrown by bytearray.pop() when the bytearray is empty.
msg129997 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-03-03 18:54
s/has to be/could be/

But yes, this would be a worthwhile addition to MutableSequence :-)
msg129998 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2011-03-03 19:05
+1.
msg130024 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-03-04 05:35
Committed in revision 88740

The non-abstract methods of MutableSequence and other classes currently seem to have no unit-tests. Any ideas about the best testing strategy for them?
msg130031 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2011-03-04 06:56
Creating a minimal concrete subclass and testing with that would be the obvious thing.
msg130040 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-03-04 09:39
Please also update the table entry for MutableSequence in Doc/library/collections.abc.rst
msg130046 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-03-04 10:38
Documentation fix and some unit tests committed in revision 88742
msg130468 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-03-09 22:27
Eli, did you leave this open on purpose or can it be closed?
History
Date User Action Args
2022-04-11 14:57:13adminsetgithub: 55597
2011-04-08 18:40:36eli.benderskysetstatus: open -> closed
resolution: fixed
2011-03-09 22:27:35r.david.murraysetnosy: + r.david.murray
messages: + msg130468
2011-03-04 10:38:50eli.benderskysetnosy: georg.brandl, rhettinger, terry.reedy, ncoghlan, stutzbach, eli.bendersky, daniel.urban
messages: + msg130046
2011-03-04 09:39:14rhettingersetnosy: georg.brandl, rhettinger, terry.reedy, ncoghlan, stutzbach, eli.bendersky, daniel.urban
messages: + msg130040
2011-03-04 06:56:43georg.brandlsetnosy: georg.brandl, rhettinger, terry.reedy, ncoghlan, stutzbach, eli.bendersky, daniel.urban
messages: + msg130031
2011-03-04 05:35:43eli.benderskysetnosy: georg.brandl, rhettinger, terry.reedy, ncoghlan, stutzbach, eli.bendersky, daniel.urban
messages: + msg130024
2011-03-03 19:22:21daniel.urbansetnosy: + daniel.urban
2011-03-03 19:05:50georg.brandlsetnosy: georg.brandl, rhettinger, terry.reedy, ncoghlan, stutzbach, eli.bendersky
messages: + msg129998
2011-03-03 18:54:42rhettingersetnosy: + stutzbach
messages: + msg129997
2011-03-03 18:36:45eli.benderskycreate