FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix typo in object.__format__ documentation by hroskes · Pull Request #19504 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion Doc/reference/datamodel.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ Basic customization

.. versionchanged:: 3.7
``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather
than ``format(str(self), '')``.
than ``format(str(x), '')``.
Comment on lines 1352 to +1353

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

From looking over the bpo issue and PR, it looks like Serhiy got the above explanation and example implementation mixed up a bit. It could make sense if he were using an instance of object, such as obj with something like this:

``obj.__format__('') is now equivalent to ``str(self)`` rather
than ``format(str(self))``.

but when using the actual class object as the explanation is doing, it does not make as much sense IMO to refer to self.

So, I tentatively agree with the PR, but I would prefer if @serhiy-storchaka could give it a final look-over.



.. _richcmpfuncs:
Expand Down

Back | FazBrowse Home | New Git URL