This is a micro-package, containing the single function isannotated
to check
if a type hint is an Annotated
type. Annotated
objects can't be checked by
normal isinstance
checks.
pip install is_annotated
from typing import Annotated
from is_annotated import isannotated
print(isannotated(1))
# False
print(isannotated(int))
# False
print(isannotated(Annotated[int, "1"]))
# True