-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
stdlib: more deprecations #11009
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
Merged
Merged
stdlib: more deprecations #11009
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
620109c
stdlib: more deprecations
JelleZijlstra 60119d6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c23c876
Make asyncio deprecation conditional
JelleZijlstra 367104a
drop deprecated @property
JelleZijlstra 372fa73
Merge remote-tracking branch 'upstream/main' into deprecations
JelleZijlstra c313169
Undo argparse to see if pytype becomes happier
JelleZijlstra 25cf5a7
Revert "Undo argparse to see if pytype becomes happier"
JelleZijlstra c338052
Revert "drop deprecated @property"
JelleZijlstra 158773e
Merge branch 'main' into deprecations
AlexWaygood 592a5f3
Merge branch 'main' into deprecations
AlexWaygood e451001
Merge branch 'main' into deprecations
JelleZijlstra 62853a8
Appease stubtest
JelleZijlstra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert "Undo argparse to see if pytype becomes happier"
This reverts commit c313169.
- Loading branch information
commit 25cf5a71ba26aa8aa40e6a9f17ac999c22c2dd26
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ from _typeshed import sentinel | |
from collections.abc import Callable, Generator, Iterable, Sequence | ||
from re import Pattern | ||
from typing import IO, Any, Generic, NewType, NoReturn, Protocol, TypeVar, overload | ||
from typing_extensions import Literal, Self, TypeAlias | ||
from typing_extensions import Literal, Self, TypeAlias, deprecated | ||
|
||
__all__ = [ | ||
"ArgumentParser", | ||
|
@@ -337,11 +337,23 @@ class Action(_AttributeHolder): | |
|
||
if sys.version_info >= (3, 12): | ||
class BooleanOptionalAction(Action): | ||
@overload | ||
def __init__( | ||
self, | ||
option_strings: Sequence[str], | ||
dest: str, | ||
default: _T | str | None = None, | ||
default: bool | None = None, | ||
*, | ||
required: bool = False, | ||
help: str | None = None, | ||
) -> None: ... | ||
@overload | ||
@deprecated("The `type`, `choices`, and `metavar` parameters are ignored and will be removed in Python 3.14.") | ||
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. These apparently never did anything useful, so it seems fair to emit the warning on all versions. |
||
def __init__( | ||
self, | ||
option_strings: Sequence[str], | ||
dest: str, | ||
default: _T | bool | None = None, | ||
type: Callable[[str], _T] | FileType | None = sentinel, | ||
choices: Iterable[_T] | None = sentinel, | ||
required: bool = False, | ||
|
@@ -351,11 +363,23 @@ if sys.version_info >= (3, 12): | |
|
||
elif sys.version_info >= (3, 9): | ||
class BooleanOptionalAction(Action): | ||
@overload | ||
def __init__( | ||
self, | ||
option_strings: Sequence[str], | ||
dest: str, | ||
default: bool | None = None, | ||
*, | ||
required: bool = False, | ||
help: str | None = None, | ||
) -> None: ... | ||
@overload | ||
@deprecated("The `type`, `choices`, and `metavar` parameters are ignored and will be removed in Python 3.14.") | ||
def __init__( | ||
self, | ||
option_strings: Sequence[str], | ||
dest: str, | ||
default: _T | str | None = None, | ||
default: _T | bool | None = None, | ||
type: Callable[[str], _T] | FileType | None = None, | ||
choices: Iterable[_T] | None = None, | ||
required: bool = False, | ||
|
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.
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.
It appears that a non-bool default doesn't really make sense on this action.