Skip to content
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

Add support for dataclasses with InitVar #18

Closed
wants to merge 3 commits into from

Conversation

tokarenko
Copy link

  • Ignore init-only variables as they go out of scope when object is
    encoded (serialized)
  • Warn on encoding (serialization) of dataclass with InitVar without
    default value: decoding (deserialization) is impossible!

- Ignore init-only variables as they go out of scope when object is
encoded (serialized)
- Warn on encoding (serialization) of dataclass with InitVar without
default value: decoding (deserialization) is impossible!
@dkraczkowski
Copy link
Contributor

@tokarenko Thanks for your contribution. Could you please import InitVar from dataclasses package? Otherwise this will not work.

@tokarenko
Copy link
Author

@tokarenko Thanks for your contribution. Could you please import InitVar from dataclasses package? Otherwise this will not work.

Done. I am sorry for missing the import while copying code from another repository...

@dkraczkowski
Copy link
Contributor

@tokarenko No worries. Could you also please cover the functionality with a test?

@dkraczkowski
Copy link
Contributor

@tokarenko Fixed in: #20

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