mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-30052: Link bytes & bytearray to stdtypes not functions (GH-1271)
Builtin container types have two potential link targets in the docs: - their entry in the list of builtin callables - their type documentation This change brings `bytes` and `bytearray` into line with other container types by having cross-references default to linking to their type documentation, rather than their builtin callable entry.
This commit is contained in:
parent
d819ad9832
commit
c6db4811f9
3 changed files with 98 additions and 89 deletions
|
|
@ -320,9 +320,9 @@ Sequences
|
|||
|
||||
A bytes object is an immutable array. The items are 8-bit bytes,
|
||||
represented by integers in the range 0 <= x < 256. Bytes literals
|
||||
(like ``b'abc'``) and the built-in function :func:`bytes` can be used to
|
||||
construct bytes objects. Also, bytes objects can be decoded to strings
|
||||
via the :meth:`~bytes.decode` method.
|
||||
(like ``b'abc'``) and the built-in :func:`bytes()` constructor
|
||||
can be used to create bytes objects. Also, bytes objects can be
|
||||
decoded to strings via the :meth:`~bytes.decode` method.
|
||||
|
||||
Mutable sequences
|
||||
.. index::
|
||||
|
|
@ -349,9 +349,9 @@ Sequences
|
|||
.. index:: bytearray
|
||||
|
||||
A bytearray object is a mutable array. They are created by the built-in
|
||||
:func:`bytearray` constructor. Aside from being mutable (and hence
|
||||
unhashable), byte arrays otherwise provide the same interface and
|
||||
functionality as immutable bytes objects.
|
||||
:func:`bytearray` constructor. Aside from being mutable
|
||||
(and hence unhashable), byte arrays otherwise provide the same interface
|
||||
and functionality as immutable :class:`bytes` objects.
|
||||
|
||||
.. index:: module: array
|
||||
|
||||
|
|
@ -1253,8 +1253,8 @@ Basic customization
|
|||
|
||||
.. index:: builtin: bytes
|
||||
|
||||
Called by :func:`bytes` to compute a byte-string representation of an
|
||||
object. This should return a ``bytes`` object.
|
||||
Called by :ref:`bytes <func-bytes>` to compute a byte-string representation
|
||||
of an object. This should return a :class:`bytes` object.
|
||||
|
||||
.. index::
|
||||
single: string; __format__() (object method)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue