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
Dataclass deepcopy 1.10 #4963
Dataclass deepcopy 1.10 #4963
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
👍🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add __copy__
and a test for that
I'd rather have only __copy__
and deepcopy fallbacking to it rather than only __deepcopy__
.
Fine if you implement both methods though
@PrettyWood Sure, I'll add Maybe |
@mbillingr Yes but here we speak about instances of |
@PrettyWood you are right, of course. Although these instances are used like types they are not supposed to pretend to be types. I have added a test and implementation for Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @PrettyWood please merge if you're happy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
ping @PrettyWood |
Thank you so much |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [pydantic](https://togithub.com/pydantic/pydantic) | `==1.10.4` -> `==1.10.5` | [![age](https://badges.renovateapi.com/packages/pypi/pydantic/1.10.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/pydantic/1.10.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/pydantic/1.10.5/compatibility-slim/1.10.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/pydantic/1.10.5/confidence-slim/1.10.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>pydantic/pydantic</summary> ### [`v1.10.5`](https://togithub.com/pydantic/pydantic/releases/tag/v1.10.5): (2023-02-15) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.4...v1.10.5) - Fix broken parametrized bases handling with `GenericModel`s with complex sets of models, [#​5052](https://togithub.com/pydantic/pydantic/issues/5052) by [@​MarkusSintonen](https://togithub.com/MarkusSintonen) - Invalidate mypy cache if plugin config changes, [#​5007](https://togithub.com/pydantic/pydantic/issues/5007) by [@​cdce8p](https://togithub.com/cdce8p) - Fix `RecursionError` when deep-copying dataclass types wrapped by pydantic, [#​4949](https://togithub.com/pydantic/pydantic/issues/4949) by [@​mbillingr](https://togithub.com/mbillingr) - Fix `X | Y` union syntax breaking `GenericModel`, [#​4146](https://togithub.com/pydantic/pydantic/issues/4146) by [@​thenx](https://togithub.com/thenx) - Switch coverage badge to show coverage for this branch/release, [#​5060](https://togithub.com/pydantic/pydantic/issues/5060) by [@​samuelcolvin](https://togithub.com/samuelcolvin) #### New Contributors - [@​thenx](https://togithub.com/thenx) made their first contribution in [pydantic/pydantic#4977 - [@​mbillingr](https://togithub.com/mbillingr) made their first contribution in [pydantic/pydantic#4963 - [@​MarkusSintonen](https://togithub.com/MarkusSintonen) made their first contribution in [pydantic/pydantic#5052 **Full Changelog**: pydantic/pydantic@v1.10.4...v1.10.5 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/allenporter/flux-local). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNDMuMSIsInVwZGF0ZWRJblZlciI6IjM0LjE0My4xIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [pydantic](https://togithub.com/pydantic/pydantic) | `==1.10.4` -> `==1.10.5` | [![age](https://badges.renovateapi.com/packages/pypi/pydantic/1.10.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/pydantic/1.10.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/pydantic/1.10.5/compatibility-slim/1.10.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/pydantic/1.10.5/confidence-slim/1.10.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>pydantic/pydantic</summary> ### [`v1.10.5`](https://togithub.com/pydantic/pydantic/releases/tag/v1.10.5): (2023-02-15) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.4...v1.10.5) - Fix broken parametrized bases handling with `GenericModel`s with complex sets of models, [#​5052](https://togithub.com/pydantic/pydantic/issues/5052) by [@​MarkusSintonen](https://togithub.com/MarkusSintonen) - Invalidate mypy cache if plugin config changes, [#​5007](https://togithub.com/pydantic/pydantic/issues/5007) by [@​cdce8p](https://togithub.com/cdce8p) - Fix `RecursionError` when deep-copying dataclass types wrapped by pydantic, [#​4949](https://togithub.com/pydantic/pydantic/issues/4949) by [@​mbillingr](https://togithub.com/mbillingr) - Fix `X | Y` union syntax breaking `GenericModel`, [#​4146](https://togithub.com/pydantic/pydantic/issues/4146) by [@​thenx](https://togithub.com/thenx) - Switch coverage badge to show coverage for this branch/release, [#​5060](https://togithub.com/pydantic/pydantic/issues/5060) by [@​samuelcolvin](https://togithub.com/samuelcolvin) #### New Contributors - [@​thenx](https://togithub.com/thenx) made their first contribution in [pydantic/pydantic#4977 - [@​mbillingr](https://togithub.com/mbillingr) made their first contribution in [pydantic/pydantic#4963 - [@​MarkusSintonen](https://togithub.com/MarkusSintonen) made their first contribution in [pydantic/pydantic#5052 **Full Changelog**: pydantic/pydantic@v1.10.4...v1.10.5 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/allenporter/pyrainbird). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNDMuMSIsInVwZGF0ZWRJblZlciI6IjM0LjE0My4xIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR adds a test and a fix for issue #4949.
resolves #4949