Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo in object.__format__ documentation #19504

Merged
merged 1 commit into from
Apr 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/reference/datamodel.rst
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
Contributor

Choose a reason for hiding this comment

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

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