We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Literal
1 parent e82beb5 commit 6b7df06Copy full SHA for 6b7df06
spec_classes/utils/type_checking.py
@@ -148,7 +148,7 @@ def type_label(attr_type: Type) -> str:
148
method general.
149
"""
150
if hasattr(attr_type, "__origin__"): # Generics
151
- if attr_type.__origin__ is Literal:
+ if str(attr_type.__origin__).rsplit(".", 1)[-1] == "Literal":
152
return f"Literal[{', '.join(repr(arg) for arg in attr_type.__args__)}]"
153
label = type_label(attr_type.__origin__)
154
if hasattr(attr_type, "__args__") and not any(
0 commit comments