Skip to content

Commit 05f8ad0

Browse files
bpo-20408: Fix memoryview() signature in docs (GH-24431)
(cherry picked from commit d18e5da) Co-authored-by: Mariusz Felisiak <[email protected]>
1 parent 68b9c20 commit 05f8ad0

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

Doc/library/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ are always available. They are listed here in alphabetical order.
10221022

10231023

10241024
.. _func-memoryview:
1025-
.. class:: memoryview(obj)
1025+
.. class:: memoryview(object)
10261026
:noindex:
10271027

10281028
Return a "memory view" object created from the given argument. See

Doc/library/stdtypes.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3632,17 +3632,16 @@ Memory Views
36323632
of an object that supports the :ref:`buffer protocol <bufferobjects>` without
36333633
copying.
36343634

3635-
.. class:: memoryview(obj)
3635+
.. class:: memoryview(object)
36363636

3637-
Create a :class:`memoryview` that references *obj*. *obj* must support the
3638-
buffer protocol. Built-in objects that support the buffer protocol include
3639-
:class:`bytes` and :class:`bytearray`.
3637+
Create a :class:`memoryview` that references *object*. *object* must
3638+
support the buffer protocol. Built-in objects that support the buffer
3639+
protocol include :class:`bytes` and :class:`bytearray`.
36403640

36413641
A :class:`memoryview` has the notion of an *element*, which is the
3642-
atomic memory unit handled by the originating object *obj*. For many
3643-
simple types such as :class:`bytes` and :class:`bytearray`, an element
3644-
is a single byte, but other types such as :class:`array.array` may have
3645-
bigger elements.
3642+
atomic memory unit handled by the originating *object*. For many simple
3643+
types such as :class:`bytes` and :class:`bytearray`, an element is a single
3644+
byte, but other types such as :class:`array.array` may have bigger elements.
36463645

36473646
``len(view)`` is equal to the length of :class:`~memoryview.tolist`.
36483647
If ``view.ndim = 0``, the length is 1. If ``view.ndim = 1``, the length

0 commit comments

Comments
 (0)