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

Use copy module instead of BaseModel.copy() #51

Open
pederhan opened this issue Feb 22, 2023 · 0 comments
Open

Use copy module instead of BaseModel.copy() #51

pederhan opened this issue Feb 22, 2023 · 0 comments
Milestone

Comments

@pederhan
Copy link
Member

In pydantic V2, the .copy() method will be removed from models and replaced with the ability to use the built-in copy module to copy models.

We use copying to take a copy of the config before it is modified by REPL commands, so that we can restore the overridden values after the command has been executed:

https://github.com/pederhan/harbor-cli/blob/bf929a6229953512eb7a6c9b57ecb52c874854d4/harbor_cli/main.py#L226-L233

@pederhan pederhan added this to the Pydantic V2 milestone Feb 22, 2023
@pederhan pederhan added this to Harbor Feb 22, 2023
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

No branches or pull requests

1 participant