summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2018-10-26 11:19:14 (GMT)
committerGitHub <noreply@github.com>2018-10-26 11:19:14 (GMT)
commit7cd25434164882c2093ea41ccfc7b95a05cd5cbd (patch)
tree76c33543b495e78b0e520dd4914da68dcf616dae /Doc
parente483f02423917dc4dfd25f46e5b9e6fce304777d (diff)
downloadcpython-7cd25434164882c2093ea41ccfc7b95a05cd5cbd.zip
cpython-7cd25434164882c2093ea41ccfc7b95a05cd5cbd.tar.gz
cpython-7cd25434164882c2093ea41ccfc7b95a05cd5cbd.tar.bz2
bpo-34890: Make iscoroutinefunction, isgeneratorfunction and isasyncgenfunction work with functools.partial (GH-9903)
inspect.isfunction() processes both inspect.isfunction(func) and inspect.isfunction(partial(func, arg)) correctly but some other functions in the inspect module (iscoroutinefunction, isgeneratorfunction and isasyncgenfunction) lack this functionality. This commits adds a new check in the mentioned functions in the inspect module so they can work correctly with arbitrarily nested partial functions.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/inspect.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index 50cd003..dfd78a9 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -298,6 +298,10 @@ attributes:
Return true if the object is a Python generator function.
+ .. versionchanged:: 3.8
+ Functions wrapped in :func:`functools.partial` now return true if the
+ wrapped function is a Python generator function.
+
.. function:: isgenerator(object)
@@ -311,6 +315,10 @@ attributes:
.. versionadded:: 3.5
+ .. versionchanged:: 3.8
+ Functions wrapped in :func:`functools.partial` now return true if the
+ wrapped function is a :term:`coroutine function`.
+
.. function:: iscoroutine(object)
@@ -352,6 +360,10 @@ attributes:
.. versionadded:: 3.6
+ .. versionchanged:: 3.8
+ Functions wrapped in :func:`functools.partial` now return true if the
+ wrapped function is a :term:`asynchronous generator` function.
+
.. function:: isasyncgen(object)