A canonical "isinstance" implementation for typing types?

Good call out. For completeness, here are all the other libraries I was able to track down in early 2022 with some kind of “enhanced isinstance” when I did a survey of typing-related libraries:

  • pytypes
  • runtype
  • trycast - mentioned earlier
  • typeguard - mentioned earlier
  • beartype - mentioned earlier
2 Likes