bpo-44524: Don't modify MRO when inheriting from typing.Annotated (GH… · python/cpython@23384a1 (original) (raw)
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -4568,6 +4568,11 @@ def test_annotated_in_other_types(self): | ||
4568 | 4568 | X = List[Annotated[T, 5]] |
4569 | 4569 | self.assertEqual(X[int], List[Annotated[int, 5]]) |
4570 | 4570 | |
4571 | +def test_annotated_mro(self): | |
4572 | +class X(Annotated[int, (1, 10)]): ... | |
4573 | +self.assertEqual(X.__mro__, (X, int, object), | |
4574 | +"Annotated should be transparent.") | |
4575 | + | |
4571 | 4576 | |
4572 | 4577 | class TypeAliasTests(BaseTestCase): |
4573 | 4578 | def test_canonical_usage_with_variable_annotation(self): |