diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-05-25 14:30:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-25 14:30:00 (GMT) |
commit | 05f8ad0c745016cd8b5bdbda4336688b80f45fd7 (patch) | |
tree | 7f6b6234474f1a3109c7a0dfe3be81639620971a | |
parent | 68b9c20a98887bf0a92698f8df9f28b9440970dc (diff) | |
download | cpython-05f8ad0c745016cd8b5bdbda4336688b80f45fd7.zip cpython-05f8ad0c745016cd8b5bdbda4336688b80f45fd7.tar.gz cpython-05f8ad0c745016cd8b5bdbda4336688b80f45fd7.tar.bz2 |
bpo-20408: Fix memoryview() signature in docs (GH-24431)
(cherry picked from commit d18e5dae914b1db49b25ed7729c07a535d1f0c52)
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
-rw-r--r-- | Doc/library/functions.rst | 2 | ||||
-rw-r--r-- | Doc/library/stdtypes.rst | 15 |
2 files changed, 8 insertions, 9 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 7d8a669..bc55d42 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1022,7 +1022,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 diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index c4e6b4d..e34a888 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -3632,17 +3632,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 |