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
defaultdict converted to dict after __post_init__ #1536
Labels
Comments
Hello @rshin, |
Surely better to implement a validator for |
samuelcolvin
added
feature request
and removed
bug V1
Bug related to Pydantic V1.X
labels
May 31, 2020
alex-paru
added a commit
to alex-paru/pydantic
that referenced
this issue
Oct 27, 2020
alex-paru
added a commit
to alex-paru/pydantic
that referenced
this issue
Oct 28, 2020
alex-paru
added a commit
to alex-paru/pydantic
that referenced
this issue
Oct 28, 2020
4 tasks
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug
Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:If I run the following snippet:
It prints the following:
In other words, the
defaultdict
field is converted into adict
(while preserving the keys), even though the field is annotated as DefaultDict, which is surprising. Is this intended behavior?The text was updated successfully, but these errors were encountered: