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

Remove __root__ from BaseModel typing-only attrs #3540

Merged
merged 2 commits into from Dec 19, 2021
Merged

Remove __root__ from BaseModel typing-only attrs #3540

merged 2 commits into from Dec 19, 2021

Conversation

layday
Copy link
Contributor

@layday layday commented Dec 19, 2021

Change Summary

__root__ is not a class variable nor is it always present.

The switch to ClassVar caused type errors to be reported in Pylance/Pyright.

Related issue number

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

`__root__` is not a class variable nor is it always present.

The switch to `ClassVar` caused type errors to be reported in Pylance/Pyright.
@layday
Copy link
Contributor Author

layday commented Dec 19, 2021

please review

@layday layday mentioned this pull request Dec 19, 2021
4 tasks
@samuelcolvin samuelcolvin merged commit da916f3 into pydantic:master Dec 19, 2021
@samuelcolvin
Copy link
Member

Thanks so much, looks like it was added back in the original implementation of __root__ #628 and I can't see how this would be breaking change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants