Skip to content

Treat float 1.0 as a singular count#249

Open
gaoflow wants to merge 1 commit into
jaraco:mainfrom
gaoflow:fix-232-float-one-count
Open

Treat float 1.0 as a singular count#249
gaoflow wants to merge 1 commit into
jaraco:mainfrom
gaoflow:fix-232-float-one-count

Conversation

@gaoflow

@gaoflow gaoflow commented Jun 22, 2026

Copy link
Copy Markdown

Summary

  • treat numeric count values equal to 1, such as 1.0, as singular counts
  • keep non-numeric string counts on the existing string-based path
  • add regression coverage for get_count(1.0) and plural(..., 1.0)

Fixes #232

Verification

  • python -m pytest tests/test_pwd.py -k "count or plural" -q
  • python -m pytest -q
  • python -m compileall inflect tests
  • python -m ruff format --check inflect/init.py tests/test_pwd.py
  • git diff --check upstream/main...HEAD

Note: python -m ruff check inflect/init.py tests/test_pwd.py still reports pre-existing UP006/UP007/UP035 typing modernization diagnostics across inflect/init.py that are unrelated to this change.

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.

get_count returns 2 when the float 1.0 is passed in, this leads to bad pluralizations if you have a float input

1 participant