mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-28974: object.__format__(x, '')
is now equivalent to str(x)
(#506)
rather than `format(str(self), '')`.
This commit is contained in:
parent
a66f9c6bb1
commit
7e19dbc92e
4 changed files with 12 additions and 9 deletions
|
@ -1282,6 +1282,10 @@ Basic customization
|
|||
The __format__ method of ``object`` itself raises a :exc:`TypeError`
|
||||
if passed any non-empty string.
|
||||
|
||||
.. versionchanged:: 3.7
|
||||
``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather
|
||||
than ``format(str(self), '')``.
|
||||
|
||||
|
||||
.. _richcmpfuncs:
|
||||
.. method:: object.__lt__(self, other)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue