diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2019-05-06 19:29:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-06 19:29:40 (GMT) |
commit | 96aeaec64738b730c719562125070a52ed570210 (patch) | |
tree | d68994f93014d081e9a441e7bf7dfda3aaadd402 /Doc | |
parent | 964663089547ca110199e23867b46b07ff4be88c (diff) | |
download | cpython-96aeaec64738b730c719562125070a52ed570210.zip cpython-96aeaec64738b730c719562125070a52ed570210.tar.gz cpython-96aeaec64738b730c719562125070a52ed570210.tar.bz2 |
bpo-36793: Remove unneeded __str__ definitions. (GH-13081)
Classes that define __str__ the same as __repr__ can
just inherit it from object.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/whatsnew/3.8.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 64ef6e1..d6388f8 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -811,6 +811,13 @@ Changes in Python behavior raised when getting the attribute from the type dictionary are no longer ignored. (Contributed by Serhiy Storchaka in :issue:`35459`.) +* Removed ``__str__`` implementations from builtin types :class:`bool`, + :class:`int`, :class:`float`, :class:`complex` and few classes from + the standard library. They now inherit ``__str__()`` from :class:`object`. + As result, defining the ``__repr__()`` method in the subclass of these + classes will affect they string representation. + (Contributed by Serhiy Storchaka in :issue:`36793`.) + * On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It is always ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``. Since older Python versions include the version number, it is recommended to |