bpo-44524: Don't modify MRO when inheriting from typing.Annotated by Fidget-Spinner · Pull Request #27841 · python/cpython (original) (raw)
Interestingly, Annotated[Any, 'foo'].__name__
now returns Any
, because it sets origin to Any
.
This behavior is quite opinionated, but is consistent with how get_type_hints
treats Annotated
(it strips the Annotated
information and just gives the contained type). Nonetheless, I have made it return 'Annotated'.