Skip to content

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

Open
hxperl wants to merge 1 commit into
python-pendulum:masterfrom
hxperl:fix-time-diff-for-humans-param-doc
Open

hxperl wants to merge 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

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
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.

1 participant