mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
Issue #28003: Implement PEP 525 -- Asynchronous Generators.
This commit is contained in:
parent
b96ef55d49
commit
eb6364557f
27 changed files with 2189 additions and 96 deletions
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue