Uh oh!
There was an error while loading. Please reload this page.
gh-109413: libregrtest: enable mypy's --strict-optional check on most files - #112586
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
AlexWaygood
commented
Dec 1, 2023
On hold until #112588 is merged |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
Thanks @AlexWaygood for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, @AlexWaygood, I could not cleanly backport this to |
Sorry, @AlexWaygood, I could not cleanly backport this to |
… on most files (python#112586) Co-authored-by: Victor Stinner <vstinner@python.org>
GH-112602 is a backport of this pull request to the 3.12 branch. |
AlexWaygood
commented
Dec 1, 2023
I added the "needs backport to 3.11" label to the 3.12 branch to take care of the 3.11 backport. |
…` check on most files (pythonGH-112586) (pythonGH-112602) pythongh-109413: libregrtest: enable mypy's `--strict-optional` check on most files (pythonGH-112586) (cherry picked from commit 36dbebe) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
…l` check on most files (GH-112586) (GH-112602) (#112603) [3.12] gh-109413: libregrtest: enable mypy's `--strict-optional` check on most files (GH-112586) (GH-112602) gh-109413: libregrtest: enable mypy's `--strict-optional` check on most files (GH-112586) (cherry picked from commit 36dbebe) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
… on most files (python#112586) Co-authored-by: Victor Stinner <vstinner@python.org>
… on most files (python#112586) Co-authored-by: Victor Stinner <vstinner@python.org>
Mypy's
--strict-optionalcheck is one of its most important checks, and it's enabled by default when you run mypy. It warns you if it infers that an object might be of typeFoo | Noneat runtime, even though the code is only guaranteed to work if the object is an instance ofFoo.We currently have
--strict-optionaldisabled on several files, as there were too many errors to deal with initially, and the priority was to have mypy enabled in CI so that we could work on improving the type annotations incrementally. This PR re-enables--strict-optionalon four files where it's easy to do so.