PEP 746: TypedMetadata for type checking of PEP 593 Annotated

That feels wrong since we’re asking the metadata whether the “base” type is applicable, not the other way around.


Aside: I feel we could use some better terminology around Annotated. There is no term for the first argument (I’d like to call it the base type) and the remaining arguments are called “annotations”, which is a really confusing term because we also have annotations in the Python syntax. We should call them “metadata” instead.

So I’d like the terminology to be:

Annotated[BaseType, Metadata1, Metadata2, ...]

If others agree with this terminology I can add it to the typing spec.

3 Likes