-
Couldn't load subscription status.
- Fork 311
Add option to preserve empty URL paths #1789
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
Conversation
CodSpeed Performance ReportMerging #1789 will not alter performanceComparing Summary
|
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!
| } | ||
|
|
||
| pub fn __str__(&self) -> String { | ||
| pub fn __str__(&self, py: Python<'_>) -> String { |
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.
If str(...) is called from Python, I assume this doesn't error because of a missing argument (same for other methods)?
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.
Indeed PyO3 will fill in Python<'_> as a special argument.
Co-authored-by: Victorien <[email protected]>
Co-authored-by: Victorien <[email protected]> Original-commit-hash: 400a083
Co-authored-by: Victorien <[email protected]> Original-commit-link: pydantic/pydantic-core@400a083
Change Summary
My take on #1719.
I am reasonably confident that the issue only applies to empty paths, so in this variation I named the config option
preserve_empty_path(defaultFalsefor backwards compatibility).Related issue number
pydantic/pydantic#7186
Checklist
pydantic-core(except for expected changes)