Skip to content

Accept documented float fallbacks in the to_float parameter type - #69

Merged
wolph merged 1 commit into
wolph:developfrom
rupayon123:fix/to-float-default-typing-20261028
Oct 29, 2026
Merged

wolph merged 1 commit into
wolph:developfrom
rupayon123:fix/to-float-default-typing-20261028

Conversation

@rupayon123

Copy link
Copy Markdown
Contributor

to_float documents float fallbacks such as default=0.0, but its int parameter annotation makes strict mypy and basedpyright reject that supported call. Accept the existing Number alias 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.

@wolph
wolph merged commit 882e045 into wolph:develop Oct 29, 2026
17 checks passed
wolph added a commit that referenced this pull request Oct 29, 2026
@wolph

wolph commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Thank you for the fix! A documented example that mypy rejects is a silly one indeed :)

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