]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-20408: Fix memoryview() signature in docs (GH-24431)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 25 May 2021 14:30:42 +0000 (07:30 -0700)
committerGitHub <noreply@github.com>
Tue, 25 May 2021 14:30:42 +0000 (17:30 +0300)
(cherry picked from commit d18e5dae914b1db49b25ed7729c07a535d1f0c52)

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Doc/library/functions.rst
Doc/library/stdtypes.rst

index ce0d532617806eced6b21d79499ac0f661ea8a73..784bb62e64a1671dd21d8a84fc4433016b8418d0 100644 (file)
@@ -964,7 +964,7 @@ are always available.  They are listed here in alphabetical order.
 
 
 .. _func-memoryview:
-.. class:: memoryview(obj)
+.. class:: memoryview(object)
    :noindex:
 
    Return a "memory view" object created from the given argument.  See
index 8a03b73b7650d41df9cdf32c945d6b5c70741c99..acaf99b7c810151bf347a553003e886b233cdec6 100644 (file)
@@ -3609,17 +3609,16 @@ Memory Views
 of an object that supports the :ref:`buffer protocol <bufferobjects>` without
 copying.
 
-.. class:: memoryview(obj)
+.. class:: memoryview(object)
 
-   Create a :class:`memoryview` that references *obj*.  *obj* must support the
-   buffer protocol.  Built-in objects that support the buffer protocol include
-   :class:`bytes` and :class:`bytearray`.
+   Create a :class:`memoryview` that references *object*.  *object* must
+   support the buffer protocol.  Built-in objects that support the buffer
+   protocol include :class:`bytes` and :class:`bytearray`.
 
    A :class:`memoryview` has the notion of an *element*, which is the
-   atomic memory unit handled by the originating object *obj*.  For many
-   simple types such as :class:`bytes` and :class:`bytearray`, an element
-   is a single byte, but other types such as :class:`array.array` may have
-   bigger elements.
+   atomic memory unit handled by the originating *object*.  For many simple
+   types such as :class:`bytes` and :class:`bytearray`, an element is a single
+   byte, but other types such as :class:`array.array` may have bigger elements.
 
    ``len(view)`` is equal to the length of :class:`~memoryview.tolist`.
    If ``view.ndim = 0``, the length is 1. If ``view.ndim = 1``, the length