gh-84753: Clarify change made to inspect functions (#94554)

This commit is contained in:
Łukasz Langa 2022-07-05 14:14:19 +02:00 committed by GitHub
parent 92bcb26d00
commit a2a3f2c541
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.