If one tries to specialize on an argument with a Literal[_] type, they get TypeError: typing.Literal cannot be used with issubclass(). It'd be nice to have support for this; I suspect patching issubclass to add the following rules would work:
Duplicate of #44. As of 5f4bf2a, literals are partially supported. The params will participate as a subclass check (but not actually check the literal values).
If one tries to specialize on an argument with a
Literal[_]
type, they getTypeError: typing.Literal cannot be used with issubclass()
. It'd be nice to have support for this; I suspect patchingissubclass
to add the following rules would work:Literal[x] <: Literal[x]
Literal[x] <: type(x)