diff options
author | Yury Selivanov <yury@magic.io> | 2016-09-09 05:01:51 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2016-09-09 05:01:51 (GMT) |
commit | eb6364557f9bc4e6be29bb8a8f43308a0e080aba (patch) | |
tree | 05b7aed24dce255be67e7a60c021c319d13f43c9 /Lib/inspect.py | |
parent | b96ef55d493aded2dea18b0208070bdfab4ceb73 (diff) | |
download | cpython-eb6364557f9bc4e6be29bb8a8f43308a0e080aba.zip cpython-eb6364557f9bc4e6be29bb8a8f43308a0e080aba.tar.gz cpython-eb6364557f9bc4e6be29bb8a8f43308a0e080aba.tar.bz2 |
Issue #28003: Implement PEP 525 -- Asynchronous Generators.
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index 72c1691..2380095 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -185,6 +185,13 @@ def iscoroutinefunction(object): return bool((isfunction(object) or ismethod(object)) and object.__code__.co_flags & CO_COROUTINE) +def isasyncgenfunction(object): + return bool((isfunction(object) or ismethod(object)) and + object.__code__.co_flags & CO_ASYNC_GENERATOR) + +def isasyncgen(object): + return isinstance(object, types.AsyncGeneratorType) + def isgenerator(object): """Return true if the object is a generator. |