From 04e411e65f327cbadd6999ec261e730f62af6f12 Mon Sep 17 00:00:00 2001 From: andreamattei97 Date: Sat, 6 Aug 2022 11:55:59 +0200 Subject: [PATCH 1/4] gh-95276: Add callable entry to the glossary --- Doc/glossary.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 7950ec4e206e40..8d74993cc01b54 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -203,6 +203,12 @@ Glossary A list of bytecode instructions can be found in the documentation for :ref:`the dis module `. + callable + A callable is an object that has the pointer :c:member:`~PyTypeObject.tp_call` + not ``NULL`` and set to a function. Python functions and object methods + are callables. An instance of a class that implements the :meth:`~object.__call__` + method is also a callable. + callback A subroutine function which is passed as an argument to be executed at some point in the future. From c51fdc16baf30f744e179f62dea9a5b86be8d780 Mon Sep 17 00:00:00 2001 From: andreamattei97 Date: Sat, 6 Aug 2022 13:34:40 +0200 Subject: [PATCH 2/4] improve entry --- Doc/glossary.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 8d74993cc01b54..ee66cb72cebee6 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -204,9 +204,13 @@ Glossary :ref:`the dis module `. callable - A callable is an object that has the pointer :c:member:`~PyTypeObject.tp_call` - not ``NULL`` and set to a function. Python functions and object methods - are callables. An instance of a class that implements the :meth:`~object.__call__` + A callable is an object that is possible to execute, possibly with a set + of arguments (see :term:`argument`), with the following syntax:: + + callable(argument1, argument2, ...) + + A :term:`function`, and by extension a :term:`method`, is a callable. + An instance of a class that implements the :meth:`~object.__call__` method is also a callable. callback From f57e6e6cfe095f53bd444affcbc0092f455e974a Mon Sep 17 00:00:00 2001 From: MonadChains Date: Mon, 26 Sep 2022 00:18:13 +0200 Subject: [PATCH 3/4] Remove extra whitespaces --- Doc/glossary.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index ee66cb72cebee6..2659eb93ae012e 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -207,7 +207,7 @@ Glossary A callable is an object that is possible to execute, possibly with a set of arguments (see :term:`argument`), with the following syntax:: - callable(argument1, argument2, ...) + callable(argument1, argument2, ...) A :term:`function`, and by extension a :term:`method`, is a callable. An instance of a class that implements the :meth:`~object.__call__` From 4e2bda33f07100f2cad7500e8de3817523cbc7d9 Mon Sep 17 00:00:00 2001 From: MonadChains Date: Tue, 11 Oct 2022 00:07:19 +0200 Subject: [PATCH 4/4] Update glossary.rst --- Doc/glossary.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 2659eb93ae012e..de6dd9bda39ae9 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -204,7 +204,7 @@ Glossary :ref:`the dis module `. callable - A callable is an object that is possible to execute, possibly with a set + A callable is an object that can be called, possibly with a set of arguments (see :term:`argument`), with the following syntax:: callable(argument1, argument2, ...)