-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise an error when using field(init=False) #9
Comments
Hi @schobster , thanks a lot, I actually started on this one, I forgot to assign it to me. I will assign the #10 to you. |
Just hit this one, but in a slightly different way. I have a field that's marked as init=False, and doesn't have a corresponding field to map into it, and dataclass_csv doesn't like that much:
|
It looks like the fix in #15 should fix my side of the issue as well. |
Solved #15 |
Description
The issue occurs when defining a field in the
dataclass
with the propertyinit=False
. When itinit
property is set to false it means that the auto-generateddataclass
initializer won't add the field in the list of arguments.How to reproduce
dataclass
and setinit=False
in one of the fields, for example:Expected behavior
When setting
init=False
in adataclass
field, the field should not be passed to thedataclass
initializer.Other information
OS: Debian 4.9.130-2
Python version: 3.7.1
dataclass-csv version: 1.0.1
The text was updated successfully, but these errors were encountered: