diff options
author | Georg Brandl <georg@python.org> | 2007-11-22 11:00:28 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-11-22 11:00:28 (GMT) |
commit | 9541463a7d38fde1109a275599455991aa6b8890 (patch) | |
tree | f0688da392a0cae271f60d5cdd1c3b9813ffae6b /Doc/library/functions.rst | |
parent | faddf1fb224d80f0ab4a25b9ef597c4d66989ef4 (diff) | |
download | cpython-9541463a7d38fde1109a275599455991aa6b8890.zip cpython-9541463a7d38fde1109a275599455991aa6b8890.tar.gz cpython-9541463a7d38fde1109a275599455991aa6b8890.tar.bz2 |
Update docs for buffer -> bytearray rename.
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r-- | Doc/library/functions.rst | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index d554a08..752bd50 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -118,18 +118,18 @@ available. They are listed here in alphabetical order. .. index:: pair: Boolean; type -.. function:: buffer([arg[, encoding[, errors]]]) +.. function:: bytearray([arg[, encoding[, errors]]]) - Return a new array of bytes. The :class:`buffer` type is an immutable sequence - of integers in the range 0 <= x < 256. It has most of the usual methods of - mutable sequences, described in :ref:`typesseq-mutable`, as well as most methods - that the :class:`str` type has, see :ref:`bytes-methods`. + Return a new array of bytes. The :class:`bytearray` type is an immutable + sequence of integers in the range 0 <= x < 256. It has most of the usual + methods of mutable sequences, described in :ref:`typesseq-mutable`, as well + as most methods that the :class:`str` type has, see :ref:`bytes-methods`. The optional *arg* parameter can be used to initialize the array in a few different ways: * If it is a *string*, you must also give the *encoding* (and optionally, - *errors*) parameters; :func:`buffer` then converts the Unicode string to + *errors*) parameters; :func:`bytearray` then converts the Unicode string to bytes using :meth:`str.encode`. * If it is an *integer*, the array will have that size and will be @@ -148,8 +148,8 @@ available. They are listed here in alphabetical order. Return a new "bytes" object, which is an immutable sequence of integers in the range ``0 <= x < 256``. :class:`bytes` is an immutable version of - :class:`buffer` -- it has the same non-mutating methods and the same indexing - and slicing behavior. + :class:`bytearray` -- it has the same non-mutating methods and the same + indexing and slicing behavior. Accordingly, constructor arguments are interpreted as for :func:`buffer`. |