Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.1k
Add 3.14 Deprecations#14289
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
Uh oh!
There was an error while loading. Please reload this page.
Add 3.14 Deprecations #14289
Changes from all commits
87447ec2e34041c52f7867b928865c5315a74badea0f14badda6d4516661c351e2e617ed659032bffae4647bb88d40fc6c83efd5d90c97d47eccbac4f5c98128a17433de835b8c4456394c49d67d0fb158f97cb95c89ea73034a9d4fbdb043e6d01209ac70324a61a3e108f932605bfaaa601fbcc157e32a43832File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,47 @@ | ||
| from __future__ import annotations | ||
| import inspect | ||
| from asyncio import iscoroutinefunction | ||
| from collections.abc import Awaitable, Callable, Coroutine | ||
| from types import CoroutineType | ||
| from typing import Any | ||
| from typing_extensions import assert_type | ||
| def test_iscoroutinefunction( | ||
| # asyncio.iscoroutinefunction is deprecated, expecting a warning. | ||
| def test_iscoroutinefunction_asyncio( | ||
| x: Callable[[str, int], Coroutine[str, int, bytes]], | ||
| y: Callable[[str, int], Awaitable[bytes]], | ||
| z: Callable[[str, int], str | Awaitable[bytes]], | ||
| xx: object, | ||
| ) -> None: | ||
| if iscoroutinefunction(x): | ||
| if iscoroutinefunction(x): # pyright: ignore | ||
| assert_type(x, Callable[[str, int], Coroutine[str, int, bytes]]) | ||
| if iscoroutinefunction(y): | ||
| if iscoroutinefunction(y): # pyright: ignore | ||
| assert_type(y, Callable[[str, int], Coroutine[Any, Any, bytes]]) | ||
| if iscoroutinefunction(z): | ||
| if iscoroutinefunction(z): # pyright: ignore | ||
| assert_type(z, Callable[[str, int], Coroutine[Any, Any, Any]]) | ||
| if iscoroutinefunction(xx): | ||
| if iscoroutinefunction(xx): # pyright: ignore | ||
| assert_type(xx, Callable[..., Coroutine[Any, Any, Any]]) | ||
| def test_iscoroutinefunction_inspect( | ||
| x: Callable[[str, int], Coroutine[str, int, bytes]], | ||
| y: Callable[[str, int], Awaitable[bytes]], | ||
| z: Callable[[str, int], str | Awaitable[bytes]], | ||
| xx: object, | ||
| ) -> None: | ||
| if inspect.iscoroutinefunction(x): | ||
| assert_type(x, Callable[[str, int], Coroutine[str, int, bytes]]) | ||
| if inspect.iscoroutinefunction(y): | ||
| assert_type(y, Callable[[str, int], CoroutineType[Any, Any, bytes]]) | ||
| if inspect.iscoroutinefunction(z): | ||
| assert_type(z, Callable[[str, int], CoroutineType[Any, Any, Any]]) | ||
| if inspect.iscoroutinefunction(xx): | ||
| assert_type(xx, Callable[..., CoroutineType[Any, Any, Any]]) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -91,15 +91,40 @@ class _ActionsContainer: | ||
| version: str = ..., | ||
| **kwargs: Any, | ||
| ) -> Action: ... | ||
| def add_argument_group( | ||
| self, | ||
| title: str | None = None, | ||
| description: str | None = None, | ||
| *, | ||
| prefix_chars: str = ..., | ||
| argument_default: Any = ..., | ||
| conflict_handler: str = ..., | ||
| ) -> _ArgumentGroup: ... | ||
| if sys.version_info >= (3, 14): | ||
| @overload | ||
| def add_argument_group( | ||
| self, | ||
| title: str | None = None, | ||
| description: str | None = None, | ||
| *, | ||
| # argument_default's type must be valid for the arguments in the group | ||
| argument_default: Any = ..., | ||
max-muoto marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| conflict_handler: str = ..., | ||
| ) -> _ArgumentGroup: ... | ||
| @overload | ||
| @deprecated("Passing 'prefix_chars' to add_argument_group() is deprecated") | ||
| def add_argument_group( | ||
| self, | ||
| title: str | None = None, | ||
| description: str | None = None, | ||
| *, | ||
| prefix_chars: str, | ||
| argument_default: Any = ..., | ||
| conflict_handler: str = ..., | ||
| ) -> _ArgumentGroup: ... | ||
| else: | ||
| def add_argument_group( | ||
| self, | ||
| title: str | None = None, | ||
| description: str | None = None, | ||
| *, | ||
| prefix_chars: str = ..., | ||
| # argument_default's type must be valid for the arguments in the group | ||
| argument_default: Any = ..., | ||
max-muoto marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| conflict_handler: str = ..., | ||
| ) -> _ArgumentGroup: ... | ||
| def add_mutually_exclusive_group(self, *, required: bool = False) -> _MutuallyExclusiveGroup: ... | ||
| def _add_action(self, action: _ActionT) -> _ActionT: ... | ||
| def _remove_action(self, action: Action) -> None: ... | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| import sys | ||
| from collections.abc import Awaitable, Callable, Coroutine | ||
| from typing import Any, TypeVar, overload | ||
| from typing_extensions import ParamSpec, TypeGuard, TypeIs | ||
| from typing_extensions import ParamSpec, TypeGuard, TypeIs, deprecated | ||
| # Keep asyncio.__all__ updated with any changes to __all__ here | ||
| if sys.version_info >= (3, 11): | ||
| @@ -17,11 +17,15 @@ if sys.version_info < (3, 11): | ||
| def coroutine(func: _FunctionT) -> _FunctionT: ... | ||
| @overload | ||
| @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") | ||
| 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") | ||
| def iscoroutinefunction(func: Callable[_P, object]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, Any]]]: ... | ||
| @overload | ||
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") | ||
Comment on lines
+20
to
+29
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
| def iscoroutinefunction(func: object) -> TypeGuard[Callable[..., Coroutine[Any, Any, Any]]]: ... | ||
| def iscoroutine(obj: object) -> TypeIs[Coroutine[Any, Any, Any]]: ... | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -7,7 +7,7 @@ from inspect import _SourceObjectType | ||
| from linecache import _ModuleGlobals | ||
| from types import CodeType, FrameType, TracebackType | ||
| from typing import IO, Any, ClassVar, Final, Literal, TypeVar | ||
| from typing_extensions import ParamSpec, Self, TypeAlias | ||
| from typing_extensions import ParamSpec, Self, TypeAlias, deprecated | ||
| __all__ = ["run", "pm", "Pdb", "runeval", "runctx", "runcall", "set_trace", "post_mortem", "help"] | ||
| if sys.version_info >= (3, 14): | ||
| @@ -59,7 +59,15 @@ class Pdb(Bdb, Cmd): | ||
| stack: list[tuple[FrameType, int]] | ||
| curindex: int | ||
| curframe: FrameType | None | ||
| curframe_locals: Mapping[str, Any] | ||
| if sys.version_info >= (3, 13): | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3.13 due as - | ||
| @property | ||
| @deprecated("curframe_locals is deprecated. Derived debuggers should access pdb.Pdb.curframe.f_locals instead.") | ||
| def curframe_locals(self) -> Mapping[str, Any]: ... | ||
| @curframe_locals.setter | ||
| @deprecated("curframe_locals is deprecated. Derived debuggers should access pdb.Pdb.curframe.f_locals instead.") | ||
| def curframe_locals(self, value: Mapping[str, Any]) -> None: ... | ||
| else: | ||
| curframe_locals: Mapping[str, Any] | ||
| if sys.version_info >= (3, 14): | ||
| mode: _Mode | None | ||
| colorize: bool | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.