From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 5 Jul 2022 12:24:25 +0000 (-0700) Subject: gh-84753: Clarify change made to `inspect` functions (GH-94554) (GH-94559) X-Git-Tag: v3.10.6~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3472f3b6e50683a76a6a5ae745b14f4588e632aa;p=thirdparty%2FPython%2Fcpython.git gh-84753: Clarify change made to `inspect` functions (GH-94554) (GH-94559) (cherry picked from commit a2a3f2c541290fc8f0720d1abdc12d564b856c28) Co-authored-by: Ɓukasz Langa --- diff --git a/Misc/NEWS.d/next/Library/2022-06-21-11-40-31.gh-issue-84753.FW1pxO.rst b/Misc/NEWS.d/next/Library/2022-06-21-11-40-31.gh-issue-84753.FW1pxO.rst index f701d2a1afeb..eeae2edf7161 100644 --- a/Misc/NEWS.d/next/Library/2022-06-21-11-40-31.gh-issue-84753.FW1pxO.rst +++ b/Misc/NEWS.d/next/Library/2022-06-21-11-40-31.gh-issue-84753.FW1pxO.rst @@ -1,3 +1,7 @@ -:func:`inspect.iscoroutinefunction` now properly returns ``True`` when an instance -of :class:`unittest.mock.AsyncMock` is passed to it. This makes it consistent with +:func:`inspect.iscoroutinefunction`, :func:`inspect.isgeneratorfunction`, +and :func:`inspect.isasyncgenfunction` now properly return ``True`` for +duck-typed function-like objects like instances of +:class:`unittest.mock.AsyncMock`. + +This makes :func:`inspect.iscoroutinefunction` consistent with the behavior of :func:`asyncio.iscoroutinefunction`. Patch by Mehdi ABAAKOUK.