gh-94912: Added marker for non-standard coroutine function detection#99247
Merged
gvanrossum merged 16 commits intopython:mainfrom Dec 18, 2022
Merged
gh-94912: Added marker for non-standard coroutine function detection#99247gvanrossum merged 16 commits intopython:mainfrom
gvanrossum merged 16 commits intopython:mainfrom
Conversation
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.
This is ref the discussion on #94912 to add an official way of marking callables as coroutine functions where they would not otherwise be detected.
cc. @gvanrossum @andrewgodwin I've just had time this afternoon to block off some first tests, and docs. I wanted to break ground so we keep it moving. It's very consciously drafts: please make suggestions of how you think it should go.
@gvanrossum Can I ask for a pointer on how I'm meant to set
co_flagsfor the_has_code_flag()check? 🤔cpython/Lib/inspect.py
Lines 376 to 385 in c43714f
Thanks!
First PR on CPython, so likely it's wrong 😊
% ./python.exe -m unittest test.test_inspect.TestPredicatesasyncio.iscoroutinefunctiona deprecated alias ofinspect.iscoroutinefunctionand removeasyncio.coroutines._is_coroutine#94912 OK?asyncio.iscoroutinefunctiona deprecated alias ofinspect.iscoroutinefunctionand removeasyncio.coroutines._is_coroutine#94912