mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-44524: Don't modify MRO when inheriting from typing.Annotated (GH-27841)
This commit is contained in:
parent
551da597a0
commit
23384a1749
2 changed files with 11 additions and 1 deletions
|
|
@ -4568,6 +4568,11 @@ class AnnotatedTests(BaseTestCase):
|
|||
X = List[Annotated[T, 5]]
|
||||
self.assertEqual(X[int], List[Annotated[int, 5]])
|
||||
|
||||
def test_annotated_mro(self):
|
||||
class X(Annotated[int, (1, 10)]): ...
|
||||
self.assertEqual(X.__mro__, (X, int, object),
|
||||
"Annotated should be transparent.")
|
||||
|
||||
|
||||
class TypeAliasTests(BaseTestCase):
|
||||
def test_canonical_usage_with_variable_annotation(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue