On Sun, Nov 22, 2020 at 1:55 PM Samuel Colvin <samcolvin@gmail.com> wrote:
More generally, I think runtime type checking was never the intention for type hints, in fact I think Guido specifically said somewhere that runtime type checking was not an intended use case (am I right?). However pydantic and a few other projects seem to me to have been very successful in using them for that anyway. I'd love it if python's developers could be a bit more supportive to runtime type inspection in future.

I've always held that it must be *possible* to introspect annotations at runtime, and I believe that we occasionally had to tweak static typing features to support this. But that's not the same as supporting isinstance() where the second argument is a generic type or some other special form like Any or Callable[.....].

That said, if you have a specific wish, please start a new thread on typing-sig and we'll discuss it.
 
--
--Guido van Rossum (python.org/~guido)