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

Fixing __iter__ returning private cached_property info #7570

Merged
merged 5 commits into from Sep 22, 2023

Conversation

sydney-runkle
Copy link
Member

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

Change Summary

  • Fixing __iter__ returning private cached_property info
  • By default, private computed_fields have repr set to False

Fix #7499

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: @samuelcolvin

@cloudflare-pages
Copy link

cloudflare-pages bot commented Sep 22, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 03526b8
Status: ✅  Deploy successful!
Preview URL: https://9547ed60.pydantic-docs2.pages.dev
Branch Preview URL: https://fix-iter-has-cached-properti.pydantic-docs2.pages.dev

View logs

pydantic/fields.py Outdated Show resolved Hide resolved
@sydney-runkle
Copy link
Member Author

please review

yield from self.__dict__.items()
yield from [(k, v) for (k, v) in self.__dict__.items() if not k.startswith('_')]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it should be it's own PR. The repr thing is one thing, the iter change another

@adriangb adriangb added the relnotes-fix Used for bugfixes. label Sep 22, 2023
@adriangb adriangb enabled auto-merge (squash) September 22, 2023 17:28
@adriangb adriangb merged commit 1546db3 into main Sep 22, 2023
57 checks passed
@adriangb adriangb deleted the fix-iter-has-cached-properties branch September 22, 2023 17:50
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.

Private cached properties are included in BaseModel.__iter__
4 participants