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

Fix mypy issue with subclasses of RootModel #7677

Merged
merged 5 commits into from Sep 28, 2023
Merged

Conversation

sydney-runkle
Copy link
Member

@sydney-runkle sydney-runkle commented Sep 27, 2023

Change Summary

mypy no longer errors when a subclass of RootModel is instantiated without a root keyword argument. See issue for details/

Related issue number

Fix #7463

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer: @lig

pydantic/mypy.py Outdated Show resolved Hide resolved
@cloudflare-pages
Copy link

cloudflare-pages bot commented Sep 27, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: fa02815
Status: ✅  Deploy successful!
Preview URL: https://410edfe8.pydantic-docs2.pages.dev
Branch Preview URL: https://fix-rootmodel-mypy-behavior.pydantic-docs2.pages.dev

View logs

@sydney-runkle sydney-runkle added the relnotes-fix Used for bugfixes. label Sep 27, 2023
pydantic/mypy.py Outdated Show resolved Hide resolved
@sydney-runkle
Copy link
Member Author

Please review

@dmontagu dmontagu merged commit 8f3ac4e into main Sep 28, 2023
61 checks passed
@dmontagu dmontagu deleted the fix-rootmodel-mypy-behavior branch September 28, 2023 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mypy reports "Too many positional arguments" for RootModel subclass
3 participants