diff --git a/peps/pep-0746.rst b/peps/pep-0746.rst index cfcb290db..cf94f3203 100644 --- a/peps/pep-0746.rst +++ b/peps/pep-0746.rst @@ -89,6 +89,13 @@ For example, to support a generic ``Gt`` metadata, one might write:: Implementations may be generic and may use overloads that return ``Literal[True]`` or ``Literal[False]`` to indicate if the metadata is valid for the given type. +Implementations may raise a NotImplementedError if they cannot determine if the metadata is valid for the given type. +Tools calling ``__supports_type__`` at runtime should catch this exception and treat it as if ``__supports_type__`` +was not present; they should not take this as an indication that the metadata is invalid for the type. + +Tools that use the metadata at runtime may choose to ignore the implementation of ``__supports_type__``; this PEP does not +specify how the method should be used at runtime, only that it may be available for use. + Backwards Compatibility =======================