diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/reference/datamodel.rst | 4 | ||||
-rw-r--r-- | Doc/whatsnew/3.7.rst | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 25afc35..36bd71a 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -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) diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index 57fd4e4..3a001d7 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -89,6 +89,10 @@ Other Language Changes a name are now supported. (Contributed by Serhiy Storchaka in :issue:`30024`.) +* ``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than + ``format(str(self), '')``. + (Contributed by Serhiy Storchaka in :issue:`28974`.) + New Modules =========== |