Trying to resolve or register 'metadata' like typing.Annotated
should be an error
#3280
Closed
14 tasks done
Labels
legibility
make errors helpful and Hypothesis grokable
Based on the
typing
module docs, here's a list of 'metadata types'. We should raise an explicit error if the user attempts to register or resolve them.Annotated
- Resolves strategies fromAnnotated
type #3082 handled the cases where we want to resolve it; but we still need to ban registering it or attempting to resolve bareAnnotated
ClassVar
Final
TypeAlias
Concatenate
andParamSpec
can never be registered or resolvedCallable
resolver should give a specific error message if it sees these typesTypeGuard
can never be registered, returnsst.booleans()
for any inner type.Self
type (ban)Never
(likeNoReturn
)TypeVarTuple
Unpack
LiteralString
can be banned for now; we can revisit later.Required
andNotRequired
(ban registration, resolve as inner type or error if bare). They are already implemented intyping_extensions
andmypy
(replaces #2978 to omit rambling discussion while we worked out what to do)
The text was updated successfully, but these errors were encountered: