Fix type hints of parse_obj and similar methods#405
Merged
samuelcolvin merged 1 commit intopydantic:masterfrom Feb 21, 2019
Merged
Fix type hints of parse_obj and similar methods#405samuelcolvin merged 1 commit intopydantic:masterfrom
samuelcolvin merged 1 commit intopydantic:masterfrom
Conversation
25edbe8 to
aec6968
Compare
parse_obj and similar methods
Codecov Report
@@ Coverage Diff @@
## master #405 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 14 14
Lines 2068 2068
Branches 420 420
=====================================
Hits 2068 2068 |
aec6968 to
7f336d4
Compare
7f336d4 to
c6e5fdd
Compare
Contributor
Author
|
Done. |
Member
|
awesome. Thank you very much. I'll fix another thing and deploy in a day or two. |
alexdrydew
pushed a commit
to alexdrydew/pydantic
that referenced
this pull request
Dec 23, 2023
* Mostly working ChoiceKey for int keys * Update src/validators/union.rs Co-authored-by: Samuel Colvin <s@muelcolvin.com> * Update src/validators/union.rs Co-authored-by: Samuel Colvin <s@muelcolvin.com> * Update src/validators/union.rs Co-authored-by: Samuel Colvin <s@muelcolvin.com> * address comments * address more comments * Address more comments and fix test * add tests for int choice keys * fix * add enum choices test * update repeated tag test * Set from_attributes to true by default for TaggedUnionValidator * Get test passing * fix tags_repr for ints * refactor repeated tags test * Use _extra.strict for literal validation of strs and ints * support i64 location keys, tests * change literal strict usage --------- Co-authored-by: Samuel Colvin <s@muelcolvin.com> Co-authored-by: David Montague <35119617+dmontagu@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
Methods like
BaseModel.parse_obj()orBaseModel.copy()have their return type specified asBaseModel. Because of that, valid code like this:does not type check:
This PR fixes that.
Related issue number
Checklist
HISTORY.rsthas been updated#<number>@<whomever>