From d2bd9fa32c631252885ec24cd023933f353bc5e8 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Mon, 31 Aug 2020 21:54:15 -0300 Subject: [PATCH 01/12] Doc: Fix the array.fromfile method doc The check about the f argument type was removed in this commit: https://github.com/python/cpython/commit/2c94aa567e525c82041ad68a3174d8c3acbf37e2 Thanks for Pedro Arthur Duarte (pedroarthur.jedi at gmail.com) by the help with this bug. --- Doc/library/array.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Doc/library/array.rst b/Doc/library/array.rst index ad622627724217..4a4b657032bca1 100644 --- a/Doc/library/array.rst +++ b/Doc/library/array.rst @@ -266,4 +266,3 @@ Examples:: `NumPy `_ The NumPy package defines another array type. - From 57b4ca3214b5f50b1e6b0de7bc8f7763fe02efad Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 2 Jul 2023 18:11:45 +0200 Subject: [PATCH 02/12] gh-106320: Remove private _PyInterpreterState functions (#106335) Remove private _PyThreadState and _PyInterpreterState C API functions: move them to the internal C API (pycore_pystate.h and pycore_interp.h). Don't export most of these functions anymore, but still export functions used by tests. Remove _PyThreadState_Prealloc() and _PyThreadState_Init() from the C API, but keep it in the stable API. From af754292b0bff02257b06fc3ae9e2e714de5c848 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Wed, 27 Dec 2023 19:37:33 +0000 Subject: [PATCH 03/12] Added header to instance methods' attributes table --- Doc/reference/datamodel.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index b3af5c6298d02d..123471eb134f1a 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -666,9 +666,14 @@ callable object (normally a user-defined function). single: __name__ (method attribute) single: __module__ (method attribute) -Special read-only attributes: +Special read-only attributes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. list-table:: + :header-rows: 1 + + * - Attribute + - Meaning * - .. attribute:: method.__self__ - Refers to the class instance object to which the method is From 1a438711042768a4853f99776854a47d6d431b9c Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Fri, 29 Dec 2023 17:28:09 +0000 Subject: [PATCH 04/12] Doc: Format built-in function's attributes --- Doc/reference/datamodel.rst | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 123471eb134f1a..e61a08c3ff91d4 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -809,16 +809,34 @@ Built-in functions A built-in function object is a wrapper around a C function. Examples of built-in functions are :func:`len` and :func:`math.sin` (:mod:`math` is a standard built-in module). The number and type of the arguments are -determined by the C function. Special read-only attributes: +determined by the C function. -* :attr:`!__doc__` is the function's documentation string, or ``None`` if - unavailable. See :attr:`function.__doc__`. -* :attr:`!__name__` is the function's name. See :attr:`function.__name__`. -* :attr:`!__self__` is set to ``None`` (but see the next item). -* :attr:`!__module__` is the name of - the module the function was defined in or ``None`` if unavailable. - See :attr:`function.__module__`. +Special read-only attributes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + * - Attribute + - Meaning + + * - .. attribute:: function.__doc__ + :noindex: + - The function's documentation string, or ``None`` if unavailable. + See :attr:`function.__doc__`. + + * - .. attribute:: function.__name__ + :noindex: + - The function's name. + See :attr:`function.__name__`. + + * - .. attribute:: function.__self__ + - It is set to ``None`` (but see the next item) + + * - .. attribute:: function.__module__ + :noindex: + - The name of the module the function was defined in, + or ``None`` if unavailable. See :attr:`function.__module__`. .. _builtin-methods: From d0d42d4620c36a50ac1f306dc7d958d5367019d5 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Fri, 29 Dec 2023 19:10:15 +0000 Subject: [PATCH 05/12] Doc: Replace a regular text by a clickable reference --- Doc/reference/datamodel.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index e61a08c3ff91d4..7cf09c8349fc61 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -831,7 +831,7 @@ Special read-only attributes See :attr:`function.__name__`. * - .. attribute:: function.__self__ - - It is set to ``None`` (but see the next item) + - It is set to ``None`` (but see :ref:`built-in methods `). * - .. attribute:: function.__module__ :noindex: From 37ea4183e76911fe8ae1c4cd40ddbdce05b3b860 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Sat, 30 Dec 2023 16:00:03 +0000 Subject: [PATCH 06/12] Doc: minor change --- Doc/library/array.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/array.rst b/Doc/library/array.rst index 4a4b657032bca1..ad622627724217 100644 --- a/Doc/library/array.rst +++ b/Doc/library/array.rst @@ -266,3 +266,4 @@ Examples:: `NumPy `_ The NumPy package defines another array type. + From 6d3808ab577e469718d1d860b03aa4fa43575833 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Sat, 30 Dec 2023 16:31:16 +0000 Subject: [PATCH 07/12] Doc: Rename builtin function attributes' label --- Doc/reference/datamodel.rst | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 7cf09c8349fc61..da6e91f457b8fc 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -820,21 +820,18 @@ Special read-only attributes * - Attribute - Meaning - * - .. attribute:: function.__doc__ - :noindex: + * - .. attribute:: builtin_function.__doc__ - The function's documentation string, or ``None`` if unavailable. See :attr:`function.__doc__`. - * - .. attribute:: function.__name__ - :noindex: + * - .. attribute:: builtin_function.__name__ - The function's name. See :attr:`function.__name__`. - * - .. attribute:: function.__self__ + * - .. attribute:: builtin_function.__self__ - It is set to ``None`` (but see :ref:`built-in methods `). - * - .. attribute:: function.__module__ - :noindex: + * - .. attribute:: builtin_function.__module__ - The name of the module the function was defined in, or ``None`` if unavailable. See :attr:`function.__module__`. From a1a82318d105d5f9e5d2cfd0c36c957633099f7e Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Sat, 30 Dec 2023 17:52:13 +0000 Subject: [PATCH 08/12] Doc: Add builtin_function.__qualname__ attribute --- Doc/reference/datamodel.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index da6e91f457b8fc..5ed3dd9d8ae4fe 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -828,6 +828,10 @@ Special read-only attributes - The function's name. See :attr:`function.__name__`. + * - .. attribute:: builtin_function.__qualname__ + - The function's :term:`qualified name`. + See also: :attr:`__qualname__ attributes `. + * - .. attribute:: builtin_function.__self__ - It is set to ``None`` (but see :ref:`built-in methods `). From c6ed4e6bda06e4964b7dd4491c4a38ad6adeb376 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Sat, 30 Dec 2023 22:15:06 +0000 Subject: [PATCH 09/12] Doc: Put builtin functions' attributes in alphabetic order --- Doc/reference/datamodel.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 5ed3dd9d8ae4fe..d6946ebea8ae22 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -824,6 +824,10 @@ Special read-only attributes - The function's documentation string, or ``None`` if unavailable. See :attr:`function.__doc__`. + * - .. attribute:: builtin_function.__module__ + - The name of the module the function was defined in, + or ``None`` if unavailable. See :attr:`function.__module__`. + * - .. attribute:: builtin_function.__name__ - The function's name. See :attr:`function.__name__`. @@ -835,9 +839,6 @@ Special read-only attributes * - .. attribute:: builtin_function.__self__ - It is set to ``None`` (but see :ref:`built-in methods `). - * - .. attribute:: builtin_function.__module__ - - The name of the module the function was defined in, - or ``None`` if unavailable. See :attr:`function.__module__`. .. _builtin-methods: From da72b090ca84079638c1e75a488932719b92fe05 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Sat, 30 Dec 2023 23:06:21 +0000 Subject: [PATCH 10/12] Doc: Add builtin_function.__class__ attribute --- Doc/reference/datamodel.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index d6946ebea8ae22..e5e45f1ab20361 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -820,6 +820,9 @@ Special read-only attributes * - Attribute - Meaning + * - .. attribute:: builtin_function.__class__ + - The function's class. + * - .. attribute:: builtin_function.__doc__ - The function's documentation string, or ``None`` if unavailable. See :attr:`function.__doc__`. From 3051d0cca6ffe5f483b760c173cf4b8df4ad28e4 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Sun, 31 Dec 2023 00:31:09 +0000 Subject: [PATCH 11/12] Doc: Add builtin_function.__text_signature__ attribute --- Doc/reference/datamodel.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index e5e45f1ab20361..c52bbe865e874b 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -842,6 +842,9 @@ Special read-only attributes * - .. attribute:: builtin_function.__self__ - It is set to ``None`` (but see :ref:`built-in methods `). + * - .. attribute:: builtin_function.__text_signature__ + - The function's signature as plain text, or ``None`` if unavailable. + .. _builtin-methods: From 18d148c19796f3b0e8241417ea583d9d28995d2f Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Sun, 31 Dec 2023 17:27:49 +0000 Subject: [PATCH 12/12] Doc: Improve builtin_function.__self__ definition Co-authored-by: Alex Waygood --- Doc/reference/datamodel.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index c52bbe865e874b..337afe7746d0cd 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -840,7 +840,7 @@ Special read-only attributes See also: :attr:`__qualname__ attributes `. * - .. attribute:: builtin_function.__self__ - - It is set to ``None`` (but see :ref:`built-in methods `). + - This is always ``None`` (but see :ref:`built-in methods `). * - .. attribute:: builtin_function.__text_signature__ - The function's signature as plain text, or ``None`` if unavailable.