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

Dataclasses #269

Merged
merged 5 commits into from Oct 1, 2018
Merged

Dataclasses #269

merged 5 commits into from Oct 1, 2018

Conversation

@samuelcolvin
Copy link
Owner

@samuelcolvin samuelcolvin commented Sep 28, 2018

replaces #231, fixes #178.

@codecov
Copy link

@codecov codecov bot commented Sep 28, 2018

Codecov Report

Merging #269 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master   #269   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          11     12    +1     
  Lines        1480   1514   +34     
  Branches      274    280    +6     
=====================================
+ Hits         1480   1514   +34

@samuelcolvin
Copy link
Owner Author

@samuelcolvin samuelcolvin commented Sep 28, 2018

ready.

@Gaunt @Gr1N @pauleveritt please review and let me know if you see any problems, otherwise I'll merge and deploy in a couple of days.

@pauleveritt
Copy link

@pauleveritt pauleveritt commented Sep 29, 2018

I just noticed @pydantic.dataclasses.dataclass(frozen=True) works as expected. Cool. Does it internally map to the "faux immutability" support?

@pauleveritt
Copy link

@pauleveritt pauleveritt commented Sep 29, 2018

Models using dataclass don't have .copy(), .json(), dict() for https://pydantic-docs.helpmanual.io/#serialisation

@samuelcolvin
Copy link
Owner Author

@samuelcolvin samuelcolvin commented Sep 30, 2018

faux immutability

Yes

Models using dataclass don't have .copy(), .json(), dict()

That's because they return vanilla dataclasses, I want to keep it like that. If you want the serialisation methods user normal models.

@Gr1N
Copy link
Contributor

@Gr1N Gr1N commented Sep 30, 2018

Awesome feature! LGTM!

@samuelcolvin samuelcolvin merged commit f3a278b into master Oct 1, 2018
5 checks passed
@samuelcolvin samuelcolvin deleted the dataclasses branch Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants