-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add asyncio 3.14 deprecations #15176
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Diff from mypy_primer, showing the effect of this PR on open source code: aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/web_urldispatcher.py:159:44: error: overload def [_P, _T] (func: def (*_P.args, **_P.kwargs) -> typing.Awaitable[_T`-2]) -> TypeGuard[def (*_P.args, **_P.kwargs) -> typing.Coroutine[Any, Any, _T`-2]] of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead [deprecated]
+ aiohttp/web_urldispatcher.py:159:44: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-deprecated for more info [deprecated]
+ aiohttp/web_urldispatcher.py:167:44: error: overload def [_P, _T] (func: def (*_P.args, **_P.kwargs) -> typing.Awaitable[_T`-2]) -> TypeGuard[def (*_P.args, **_P.kwargs) -> typing.Coroutine[Any, Any, _T`-2]] of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead [deprecated]
+ aiohttp/worker.py:68:44: error: overload def [_P] (func: def (*_P.args, **_P.kwargs) -> builtins.object) -> TypeGuard[def (*_P.args, **_P.kwargs) -> typing.Coroutine[Any, Any, Any]] of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead [deprecated]
|
donbarbos
left a comment
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.
Thank you, just suggestion about messages.
PR: python/cpython#122875
|
|
||
| if sys.version_info >= (3, 11): | ||
| @overload | ||
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") |
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.
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") | |
| @deprecated("Deprecated since Python 3.14. Use `inspect.iscoroutinefunction()` instead.") |
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") | ||
| def iscoroutinefunction(func: Callable[..., Coroutine[Any, Any, Any]]) -> bool: ... | ||
| @overload | ||
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") |
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.
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") | |
| @deprecated("Deprecated since Python 3.14. Use `inspect.iscoroutinefunction()` instead.") |
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") | ||
| def iscoroutinefunction(func: Callable[_P, Awaitable[_T]]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, _T]]]: ... | ||
| @overload | ||
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") |
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.
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") | |
| @deprecated("Deprecated since Python 3.14. Use `inspect.iscoroutinefunction()` instead.") |
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") | ||
| def iscoroutinefunction(func: Callable[_P, object]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, Any]]]: ... | ||
| @overload | ||
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") |
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.
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") | |
| @deprecated("Deprecated since Python 3.14. Use `inspect.iscoroutinefunction()` instead.") |
This PR adds the
asyncio.iscoroutinefunctiondeprecations from #14289 with the only core change being that we only deprecate them for >= 3.11 due to @srittau's feedback here: #14074 (comment)