Skip to content

docs: align the naturaldelta example with minute rounding - #410

Merged
hugovk merged 1 commit into
python-humanize:mainfrom
Likio3000:docs/correct-naturaldelta-minute-example-20260923
Oct 25, 2026
Merged

hugovk merged 1 commit into
python-humanize:mainfrom
Likio3000:docs/correct-naturaldelta-minute-example-20260923

Conversation

@Likio3000

@Likio3000 Likio3000 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #476.

The README still shows naturaldelta(timedelta(seconds=1001)) returning 16 minutes, although #272 changed naturaldelta to round to the nearest unit. Update the expected output to 17 minutes so the example matches the current implementation and documented behavior.

Changes proposed in this pull request:

  • Correct this one README output line; no implementation changes.

Validation: statically checked the minute branch (round(delta.seconds / 60)), the rounding docstring, the existing 1m29s/1m30s/1m59s test cases, and the changes in #272. Independently checked the arithmetic for 1001 seconds. I did not run Humanize, its test suite, linting, or the documentation build.

Prepared with assistance from OpenAI Codex.

@hugovk hugovk added documentation Improvements or additions to documentation changelog: skip Exclude PR from release draft labels Sep 26, 2026
@hugovk
hugovk enabled auto-merge (squash) September 26, 2026 21:05
@codecov

codecov Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.69%. Comparing base (392aef7) to head (bf5a961).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #410   +/-   ##
=======================================
  Coverage   99.69%   99.69%           
=======================================
  Files          12       12           
  Lines         996      996           
=======================================
  Hits          993      993           
  Misses          3        3           
Flag Coverage Δ
macos-latest 97.59% <ø> (ø)
ubuntu-latest 97.59% <ø> (ø)
windows-latest 93.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Muguett-DBY Muguett-DBY left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran all nine README date/time examples against this PR's source at bf5a961 on Windows with Python 3.12.15; all pass, including 1001 seconds → 17 minutes. The one-line correction matches the rounding behavior.

Verification assisted by Codex.

@hugovk
hugovk merged commit 5f991f6 into python-humanize:main Oct 25, 2026
46 checks passed
@hugovk

hugovk commented Oct 25, 2026

Copy link
Copy Markdown
Member

Behaviour was changed by #272 but docs not updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: skip Exclude PR from release draft documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

README naturaldelta example shows 16 minutes instead of 17 minutes

3 participants