-
-
Notifications
You must be signed in to change notification settings - Fork 298
Closed
Description
Issue description
replace_with function is typed as:
def replace_with(repl_str: str) -> ParseAction:It is my understanding that replace_with it so be used with set_parse_action to return an arbitrary object as a parse result. Also, it's own docstring has replace_with(math.nan), with a non-string argument. Finally, set_parse_action accepts a Callable with return type Any.
The current implementation works, but produces errors when type-checking, e.g. with mypy:
error: Argument 1 has incompatible type "dict[Never, Never]"; expected "str" [arg-type]
Proposed solution
I believe replace_with should have an argument of type Any.
Metadata
Metadata
Assignees
Labels
No labels