Issue #10516: added copy() and clear() methods to bytearrays as well

This commit is contained in:
Eli Bendersky 2011-03-03 18:21:02 +00:00
parent 91221f2857
commit 4db28d3343
4 changed files with 63 additions and 5 deletions

View file

@ -1675,10 +1675,10 @@ Note that while lists allow their items to be of any type, bytearray object
| ``s.extend(x)`` | same as ``s[len(s):len(s)] = | \(2) |
| | x`` | |
+------------------------------+--------------------------------+---------------------+
| ``s.clear()`` | remove all items from ``s`` | \(8) |
| ``s.clear()`` | remove all items from ``s`` | |
| | | |
+------------------------------+--------------------------------+---------------------+
| ``s.copy()`` | return a shallow copy of ``s`` | \(8) |
| ``s.copy()`` | return a shallow copy of ``s`` | |
| | | |
+------------------------------+--------------------------------+---------------------+
| ``s.count(x)`` | return number of *i*'s for | |
@ -1757,8 +1757,7 @@ Notes:
detect that the list has been mutated during a sort.
(8)
:meth:`clear`, :meth:`!copy` and :meth:`sort` are not supported by
:class:`bytearray` objects.
:meth:`sort` is not supported by :class:`bytearray` objects.
.. versionadded:: 3.3
:meth:`clear` and :meth:`!copy` methods.