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 /Lib | |
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 'Lib')
-rw-r--r-- | Lib/test/test_types.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index 28ebfb6..49dc5bf 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -1262,8 +1262,8 @@ class SimpleNamespaceTests(unittest.TestCase): ns2._y = 5 name = "namespace" - self.assertEqual(repr(ns1), "{name}(w=3, x=1, y=2)".format(name=name)) - self.assertEqual(repr(ns2), "{name}(_y=5, x='spam')".format(name=name)) + self.assertEqual(repr(ns1), "{name}(x=1, y=2, w=3)".format(name=name)) + self.assertEqual(repr(ns2), "{name}(x='spam', _y=5)".format(name=name)) def test_equal(self): ns1 = types.SimpleNamespace(x=1) @@ -1312,7 +1312,7 @@ class SimpleNamespaceTests(unittest.TestCase): ns3.spam = ns2 name = "namespace" repr1 = "{name}(c='cookie', spam={name}(...))".format(name=name) - repr2 = "{name}(spam={name}(spam={name}(...), x=1))".format(name=name) + repr2 = "{name}(spam={name}(x=1, spam={name}(...)))".format(name=name) self.assertEqual(repr(ns1), repr1) self.assertEqual(repr(ns2), repr2) |