Commit 51b55b31 authored by Yury Selivanov's avatar Yury Selivanov

Merge 3.5 (issue #28639)

parents 330322d4 1f3d4f91
......@@ -219,10 +219,10 @@ def iscoroutine(object):
return isinstance(object, types.CoroutineType)
def isawaitable(object):
"""Return true is object can be passed to an ``await`` expression."""
"""Return true if object can be passed to an ``await`` expression."""
return (isinstance(object, types.CoroutineType) or
isinstance(object, types.GeneratorType) and
object.gi_code.co_flags & CO_ITERABLE_COROUTINE or
bool(object.gi_code.co_flags & CO_ITERABLE_COROUTINE) or
isinstance(object, collections.abc.Awaitable))
def istraceback(object):
......
......@@ -40,6 +40,9 @@ Library
- Issue #26081: Fix refleak in _asyncio.Future.__iter__().throw.
- Issue #28639: Fix inspect.isawaitable to always return bool
Patch by Justin Mayfield.
Documentation
-------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment