Reading this discussion again, I think we should not add isinstance()
support for type aliases. It’s better to keep the invariants that the type
statement creates an alias that is valid in the type system, which is related to but distinct from the class hierarchy that isinstance()
uses. Similarly, we should keep the invariant that type aliases are evaluated only when .__value__
is explicitly accessed.
However, we should fix the confusing error text that @ajoino called out in Run-time behaviour of `TypeAliasType - #15 by ajoino. I would accept a PR for that.