I can't think about something precise at the moment, but it seems simpler to have something like "pytorch" or "panda" in the annotations to
explain in which context this annotation should be used, rather than parsing an expression and use some algorithm to detect if the type checker
knows how to make sense of it.

Another situation that comes to mind would be a library that is used in a context where the annotation is needed and in another where it is useless.
Not a big problem, but allowing the type checker to disregard an annotation even if it knows how to parse it might be an interesting feature.

Le sam. 25 mai 2019 à 16:42, Guido van Rossum <guido@python.org> a écrit :
On Sat, May 25, 2019 at 12:07 AM Vincent Siles <vincent.siles+pyty@gmail.com> wrote:
If my understanding is correct, a type-checker will have to parse the whole annotation payload to decide if it supports it or not.
That's seems a bit too complicated, doesn't it ? Shouldn't we add a label (like `Annotated[T, 'feature name', X]`, with type alias to shorten the whole thing if need be) to make this decision easier ?

But ISTM the type-checker has to parse the whole payload regardless. Can you elaborate an example of an annotation payload that would be a burden for the type-checker to parse?

--Guido van Rossum (python.org/~guido)
Pronouns: he/him/his (why is my pronoun here?)