Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-122858: Deprecateasyncio.iscoroutinefunction
#122875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ect.iscoroutinefunction`.
Wulian233 commentedAug 10, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
After my many fix, maybe it is normal for the Docs workflow to fail because the deprecated function But I don't know how to solve this problem. Delete whatnew/3.14.rst: (Solved) |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Library/2024-08-10-10-21-44.gh-issue-122858.ZC1rJD.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Please, use at least one test that ensures that the function is deprecated (which does not ignore the warnings).
Wulian233 commentedAug 11, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This is the function that test this functionc1f2743 If not have @ignore_warnings(category=DeprecationWarning)deftest_iscoroutinefunction(self):print("asyncio.iscoroutinefunction is deprecated, use inspect.iscoroutinefunction() instead")deffn(): ... (Sorry, I may not be familiar with it) |
I am taking over this now. |
bc9d92c
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Deprecate `asyncio.iscoroutinefunction` in favor of `inspect.iscoroutinefunction`.Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Python 3.14 will deprecate asyncio.iscoroutinefunction:python/cpython#122875inspect.iscoroutinefunction exists since 3.5 and our baselineis 3.8, so we can just use it unconditionally.Using a wrapper with @asyncio.coroutine in __get__ wasn'tnecessary (the future from asyncio.ensure_future is awaitable,and the wrapper doesn't do anything asynchronous), so thelogic can be simplified to just call asyncio.ensure_future(to schedule the task and store the result when it'savailable).
`asyncio.iscoroutinefunction` was deprecated inpython/cpython#122875.
Uh oh!
There was an error while loading.Please reload this page.
Same
inspect.iscoroutinefunction
, we don't need two different functions to do the same thing.asyncio.iscoroutinefunction
#122858