We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5d9e02 commit 51c9ab4Copy full SHA for 51c9ab4
Lib/test/test_dataclasses.py
@@ -805,6 +805,7 @@ def bar(self) -> int:
805
self.assertEqual(list(C.__annotations__), ['i'])
806
self.assertEqual(C(10).foo(), 4)
807
self.assertEqual(C(10).bar, 5)
808
+ self.assertEqual(C(10).i, 10)
809
810
def test_post_init(self):
811
# Just make sure it gets called
@@ -1488,7 +1489,7 @@ def nt(lst):
1488
1489
self.assertIs(type(t), NT)
1490
1491
def test_dynamic_class_creation(self):
- cls_dict = {'__annotations__': OrderedDict(x=int, y=int),
1492
+ cls_dict = {'__annotations__': {'x':int, 'y':int},
1493
}
1494
1495
# Create the class.
@@ -1501,7 +1502,7 @@ def test_dynamic_class_creation(self):
1501
1502
self.assertEqual(asdict(cls(1, 2)), {'x': 1, 'y': 2})
1503
1504
def test_dynamic_class_creation_using_field(self):
1505
1506
'y': field(default=5),
1507
1508
0 commit comments