Skip to content
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

Update configparser.SectionProxy.get* to return T | None when fallback is not specified #12936

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brianschubert
Copy link
Contributor

Refs #12933

Exploratory PR to see what the mypy_primer impact is.

Copy link
Contributor

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

porcupine (https://github.com/Akuli/porcupine)
+ porcupine/plugins/editorconfig.py:98: error: Item "None" of "str | None" has no attribute "lower"  [union-attr]

nox (https://github.com/wntrblm/nox)
+ nox/tox_to_nox.py:89: error: Item "None" of "Optional[str]" has no attribute "strip"  [union-attr]
+ nox/tox_to_nox.py:121: error: Argument 1 to "Path" has incompatible type "Optional[str]"; expected "Union[str, PathLike[str]]"  [arg-type]

@brianschubert
Copy link
Contributor Author

mypy_primer hits look good:

  • porcupine: uses .get("root", "false"). This will go away with #12935.
  • nox: first hit uses .get("set_env", ""), which will go away with #12935. Second hit uses .get("change_dir"), which is a true hit.

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.

1 participant