(cls, params)
| 970 | |
| 971 | @typing._tp_cache |
| 972 | def __class_getitem__(cls, params): |
| 973 | if not isinstance(params, tuple) or len(params) < 2: |
| 974 | raise TypeError("Annotated[...] should be used " |
| 975 | "with at least two arguments (a type and an " |
| 976 | "annotation).") |
| 977 | allowed_special_forms = (ClassVar, Final) |
| 978 | if get_origin(params[0]) in allowed_special_forms: |
| 979 | origin = params[0] |
| 980 | else: |
| 981 | msg = "Annotated[t, ...]: t must be a type." |
| 982 | origin = typing._type_check(params[0], msg) |
| 983 | metadata = tuple(params[1:]) |
| 984 | return _AnnotatedAlias(origin, metadata) |
| 985 | |
| 986 | def __init_subclass__(cls, *args, **kwargs): |
| 987 | raise TypeError( |
nothing calls this directly
no test coverage detected