Skip to content

Commit ca2b485

Browse files
fix(mypy): Cast Literal to type to please mypy
1 parent ba461f8 commit ca2b485

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/gallia/pydantic_argparse/utils/pydantic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def _get_type(self, annotation: type | None) -> type | tuple[type | None, ...] |
120120
origin = get_origin(annotation)
121121

122122
if origin is Literal or isinstance(origin, type) and issubclass(origin, Container):
123-
return origin
123+
return cast(type, origin) # Cast to type to cover returning Literal
124124
elif origin is Union or origin is UnionType:
125125
args = get_args(annotation)
126126
types = [arg for arg in args if arg is not NoneType]

0 commit comments

Comments
 (0)