Repository navigation
Fix when yield from was made of an AnyType - #873
Closed
rockneurotiko wants to merge 1 commit into
Closed
rockneurotiko wants to merge 1 commit into
rockneurotiko wants to merge 1 commit into
Conversation
…xample that @nierob reported in python#836) Now don't crash in: ``` import asyncio @asyncio.coroutine def example_coro(): q = asyncio.Queue() msg = yield from q.get() if __name__ == '__main__': loop = asyncio.get_event_loop() loop.run_until_complete(example_coro()) ``` But that example is because don't infer asyncio.Queue type properly as is appointed in python#836, so q is AnyType and ``` import asyncio import typing @asyncio.coroutine def foo(a): b = yield from a return b ```
|
I haven't looked into the issue much, but this commit fixes several crashes I was experiencing. |
Collaborator
|
Thanks for the PR! It would be great if you could add a test case for this as well. Also, this doesn't address the root problem, which is an unsafe cast in This can still fail if the result type is something other than |
Collaborator
|
Closing as #944 contained fixes to the issues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As reported in #868 and the generic example that @nierob reported in #836
Now don't crash in:
But that example is because don't infer asyncio.Queue type properly as
is appointed in #836, and q is AnyType (instead of asyncio.Queue)
and