diff options
author | Zackery Spytz <zspytz@gmail.com> | 2020-05-16 01:27:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-16 01:27:54 (GMT) |
commit | 6b6092f533f0e4787b8564c4fad6ec6d1018af0d (patch) | |
tree | 7b3986eeb2dd969a78a6ed63daf6df6a0c5af482 /Doc/library | |
parent | 1ce5841eca6d96b1b1e8c213d04f2e92b1619bb5 (diff) | |
download | cpython-6b6092f533f0e4787b8564c4fad6ec6d1018af0d.zip cpython-6b6092f533f0e4787b8564c4fad6ec6d1018af0d.tar.gz cpython-6b6092f533f0e4787b8564c4fad6ec6d1018af0d.tar.bz2 |
bpo-39075: types.SimpleNamespace no longer sorts attributes in its repr (GH-19430)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/types.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/types.rst b/Doc/library/types.rst index cdddb46..79acdf4 100644 --- a/Doc/library/types.rst +++ b/Doc/library/types.rst @@ -355,8 +355,7 @@ Additional Utility Classes and Functions self.__dict__.update(kwargs) def __repr__(self): - keys = sorted(self.__dict__) - items = ("{}={!r}".format(k, self.__dict__[k]) for k in keys) + items = (f"{k}={v!r}" for k, v in self.__dict__.items()) return "{}({})".format(type(self).__name__, ", ".join(items)) def __eq__(self, other): @@ -368,6 +367,9 @@ Additional Utility Classes and Functions .. versionadded:: 3.3 + .. versionchanged:: 3.9 + Attribute order in the repr changed from alphabetical to insertion (like + ``dict``). .. function:: DynamicClassAttribute(fget=None, fset=None, fdel=None, doc=None) |