Skip to content

Fix wrong parameter name in Time.diff_for_humans docstring - #1007

Merged
Secrus merged 1 commit into
python-pendulum:masterfrom
hxperl:fix-time-diff-for-humans-param-doc
Sep 19, 2026
Merged

Secrus merged 1 commit into
python-pendulum:masterfrom
hxperl:fix-time-diff-for-humans-param-doc

Conversation

@hxperl

@hxperl hxperl commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

Time.diff_for_humans documents :param dt:, but the parameter is other. Sphinx drops a :param: whose name does not match the signature, so the parameter renders undocumented.

Renamed the docstring parameter to other.

The docstring documented ":param dt: The time to subtract from", but the
parameter is named "other" and the method compares rather than subtracts.
Both the name and the description were copied from Time.diff just above,
which does take a "dt" argument. Time.diff_for_humans(dt=...) raises
TypeError.

Date.diff_for_humans, which has the identical signature, already documents
":param other: The date to compare to (defaults to today)". This mirrors
that wording.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NbQSLKhdfSRcBeGWhaaV6T
@codspeed

codspeed Bot commented Sep 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 1 untouched benchmark


Comparing hxperl:fix-time-diff-for-humans-param-doc (c3d66ee) with master (0d71391)

Open in CodSpeed

@Secrus Secrus added the docs label Sep 19, 2026
@Secrus
Secrus merged commit dd1ec83 into python-pendulum:master Sep 19, 2026
14 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants