-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
argparse: fix error __init__, add BooleanOptionalAction for py39 #4144
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
Conversation
stdlib/2and3/argparse.pyi
Outdated
class BooleanOptionalAction(Action): | ||
def __init__( | ||
self, | ||
option_strings: Sequence[Text], |
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.
This is Python 3-only so no real need to use Text
dest: Text, | ||
const: Any = ..., | ||
default: Any = ..., | ||
type: Optional[Union[Callable[[Text], _T], Callable[[str], _T], FileType]] = ..., |
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.
Should this class be generic over _T?
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.
I don't think so? Not sure what that would allows us to accomplish
stdlib/2and3/argparse.pyi
Outdated
self, | ||
option_strings: Sequence[Text], | ||
dest: Text, | ||
const: Any = ..., |
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.
I don't fully understand the description of this argument but it sounds like it and default should be of type Optional[_T]
.
Re: the unused in implementation, we'll see what happens python/cpython#11478 (review) |
python#4144 and python/cpython#11478 (review) resulted in the issue being fixed upstream. A fix in time saves a branch in typeshed :-)
#4144 and python/cpython#11478 (review) resulted in the issue being fixed upstream. Co-authored-by: hauntsaninja <>
python#4144 and python/cpython#11478 (review) resulted in the issue being fixed upstream. Co-authored-by: hauntsaninja <>
No description provided.