Skip to content

argparse: Use SupportsWrite instead of IO #13324

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 1 commit into from
Dec 30, 2024

Conversation

hamdanal
Copy link
Contributor

No description provided.

Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

mypy (https://github.com/python/mypy)
+ mypy/main.py:375: error: Argument 1 of "print_usage" is incompatible with supertype "ArgumentParser"; supertype defines the argument type as "Optional[SupportsWrite[str]]"  [override]
+ mypy/main.py:375: note: This violates the Liskov substitution principle
+ mypy/main.py:375: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
+ mypy/main.py:380: error: Argument 1 of "print_help" is incompatible with supertype "ArgumentParser"; supertype defines the argument type as "Optional[SupportsWrite[str]]"  [override]
+ mypy/main.py:380: note: This violates the Liskov substitution principle
+ mypy/main.py:380: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
+ mypy/main.py:385: error: Argument 2 of "_print_message" is incompatible with supertype "ArgumentParser"; supertype defines the argument type as "Optional[SupportsWrite[str]]"  [override]
+ mypy/main.py:385: note: This violates the Liskov substitution principle
+ mypy/main.py:385: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides

hamdanal added a commit to hamdanal/mypy that referenced this pull request Dec 28, 2024
hauntsaninja pushed a commit to python/mypy that referenced this pull request Dec 28, 2024
@JelleZijlstra JelleZijlstra merged commit ce36fd4 into python:main Dec 30, 2024
64 checks passed
@hamdanal hamdanal deleted the argparse-io branch December 30, 2024 07:56
hoel-bagard pushed a commit to hoel-bagard/typeshed that referenced this pull request Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants