dataclass-csv
dataclass-csv copied to clipboard
Fix keyword argument type in DataclassWriter
If I try to create a DataclassWriter with the keyword argument delimiter = ';', Python's type checker (I'm using Pyright) will report this error:
Argument of type "Literal[';']" cannot be assigned to parameter "delimiter" of type "Dict[str, Any]" in function "__init__"
"Literal[';']" is incompatible with "Dict[str, Any]"
This pull request contains a simple fix.
I was facing this issue as well, which is due to the specific type hint for args and kwargs: https://stackoverflow.com/questions/37031928/type-annotations-for-args-and-kwargs
I released an updated version (with up-to-date tooling) of the lib which includes this fix a dataclass-csv2 on pypi, (repo). Hopefully if/when the maintainer become active again I could merge back to upstream.