typing.Self: 'Self',
# Subscribed special forms
typing.Annotated[Any, "Annotation"]: 'Annotated',
+ typing.Annotated[int, 'Annotation']: 'Annotated',
typing.ClassVar[Any]: 'ClassVar',
typing.Concatenate[Any, SpecialAttrsP]: 'Concatenate',
typing.Final[Any]: 'Final',
if isinstance(origin, _AnnotatedAlias):
metadata = origin.__metadata__ + metadata
origin = origin.__origin__
- super().__init__(origin, origin)
+ super().__init__(origin, origin, name='Annotated')
self.__metadata__ = metadata
def copy_with(self, params):
return 'Annotated'
return super().__getattr__(attr)
+ def __mro_entries__(self, bases):
+ return (self.__origin__,)
+
class Annotated:
"""Add context specific metadata to a type.