Skip to content

Conversation

medovina
Copy link

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.

@kraktus
Copy link

kraktus commented Jan 26, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants