Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
51b55b31
Commit
51b55b31
authored
Nov 08, 2016
by
Yury Selivanov
Browse files
Options
Browse Files
Download
Plain Diff
Merge 3.5 (issue #28639)
parents
330322d4
1f3d4f91
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
Lib/inspect.py
Lib/inspect.py
+2
-2
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/inspect.py
View file @
51b55b31
...
...
@@ -219,10 +219,10 @@ def iscoroutine(object):
return
isinstance
(
object
,
types
.
CoroutineType
)
def
isawaitable
(
object
):
"""Return true i
s
object can be passed to an ``await`` expression."""
"""Return true i
f
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
):
...
...
Misc/NEWS
View file @
51b55b31
...
...
@@ -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
-------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment