Repository navigation
Accept documented float fallbacks in the to_float parameter type - #69
Merged
wolph merged 1 commit intoOct 29, 2026
Merged
Conversation
wolph
added a commit
that referenced
this pull request
Oct 29, 2026
Owner
|
Thank you for the fix! A documented example that mypy rejects is a silly one indeed :) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
to_floatdocuments float fallbacks such asdefault=0.0, but itsintparameter annotation makes strict mypy and basedpyright reject that supported call. Accept the existingNumberalias for the default and add a typed consumer regression for float fallbacks, including the regexp path and successful conversion. The default value, return annotation and conversion body stay unchanged.Validation: the consumer calls fail both strict checkers before the fix and pass afterward, including against a clean wheel installation. The focused module passes12 tests (10 existing plus2 new cases); the full suite passes376 tests with100% configured statement/branch coverage. All seven official tox environments pass: coverage, Ruff lint/format, mypy, basedpyright, pyrefly, codespell and Sphinx. Pyrefly's two warnings shown at warning visibility match the untouched base; no suppressions or checker settings changed. Wheel and source distribution builds pass. Local execution uses CPython3.13.14/macOS arm64; the other CI matrix cells remain unrun locally.