summaryrefslogtreecommitdiffstats
path: root/Doc/library/inspect.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/inspect.rst')
-rw-r--r--Doc/library/inspect.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index d21672f..66b9238 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -310,6 +310,25 @@ attributes:
.. versionadded:: 3.5
+.. function:: isawaitable(object)
+
+ Return true if the object can be used in :keyword:`await` expression.
+
+ Can also be used to distinguish generator-based coroutines from regular
+ generators::
+
+ def gen():
+ yield
+ @types.coroutine
+ def gen_coro():
+ yield
+
+ assert not isawaitable(gen())
+ assert isawaitable(gen_coro())
+
+ .. versionadded:: 3.5
+
+
.. function:: istraceback(object)
Return true if the object is a traceback.