We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
typing.Annotated[int, ...]
You can subclass Annotated[int, "meta"]:
Annotated[int, "meta"]
>>> import typing >>> class Some(typing.Annotated[int, 'meta']): ... ... >>> Some.__mro__ (<class '__main__.Some'>, <class 'int'>, <class 'object'>)
But, here are a couple of problems:
Annotated
I think that Annotated should not be subclasses and this is a bug. The PR is incoming :)
I found this while working on #96769
You can subclass
Annotated[int, "meta"]:But, here are a couple of problems:
Annotatedin the first placeAnnotatedcannot be subclassed: https://github.com/python/cpython/blame/53a54b781d1f05f2d0b40ce88b3da92d5d23e9d2/Lib/test/test_typing.py#L6562-L6565 hereI think that
Annotatedshould not be subclasses and this is a bug.The PR is incoming :)
I found this while working on #96769