Skip to content

Conversation

@Joshua-Ward1
Copy link
Contributor

Summary

Update the str() docstring to make default argument values explicit and align
the wording with the documented signature.

Rationale

The existing docstring did not surface the default values for encoding and
errors in the signature and used older wording referring to
“bytes_or_buffer”. This made the help output less clear in IDEs and interactive
tools such as help() and pydoc.

This change follows the guidance discussed in the issue and aligns the docstring
with the current documentation style.

Changes

  • Update the str() docstring signature to include default values for
    encoding and errors
  • Replace obsolete “bytes_or_buffer” wording with “bytes-like object”
  • Remove redundant prose describing default values now shown in the signature
  • Add tests to verify the updated pydoc output
  • Add a NEWS entry describing the user-visible documentation change

Testing

  • Updated and added coverage in Lib/test/test_pydoc/test_pydoc.py

Related issue

Copy link
Member

Choose a reason for hiding this comment

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

This NEWS entry is in the wrong category, but this is just a docs change so we don't need it at all.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants