mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Undo the deprecation of _asdict().
Backed out changeset c4ca39bece9d
This commit is contained in:
parent
4e0172fd9a
commit
163e9821b4
4 changed files with 4 additions and 16 deletions
|
@ -217,11 +217,8 @@ class TestNamedTuple(unittest.TestCase):
|
|||
self.assertEqual(p, Point._make([11, 22])) # test _make classmethod
|
||||
self.assertEqual(p._fields, ('x', 'y')) # test _fields attribute
|
||||
self.assertEqual(p._replace(x=1), (1, 22)) # test _replace method
|
||||
self.assertEqual(p.__dict__,
|
||||
OrderedDict([('x', 11), ('y', 22)])) # test __dict__ attribute
|
||||
self.assertEqual(vars(p), p.__dict__) # verify that vars() works
|
||||
with self.assertWarns(DeprecationWarning): # check deprecate of _asdict
|
||||
p._asdict()
|
||||
self.assertEqual(p._asdict(), dict(x=11, y=22)) # test _asdict method
|
||||
self.assertEqual(vars(p), p._asdict()) # verify that vars() works
|
||||
|
||||
try:
|
||||
p._replace(x=1, error=2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue