Subclass all single host url classes from AnyUrl to preserve behavior from v2.9#10856
Merged
sydney-runkle merged 2 commits intomainfrom Nov 18, 2024
Merged
Subclass all single host url classes from AnyUrl to preserve behavior from v2.9#10856sydney-runkle merged 2 commits intomainfrom
AnyUrl to preserve behavior from v2.9#10856sydney-runkle merged 2 commits intomainfrom
Conversation
Deploying pydantic-docs with
|
| Latest commit: |
48d1503
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4662b687.pydantic-docs.pages.dev |
| Branch Preview URL: | https://any-url-base-type.pydantic-docs.pages.dev |
sydney-runkle
commented
Nov 15, 2024
| def host(self) -> str: | ||
| """The required URL host.""" | ||
| return self._url.host # type: ignore | ||
| return self._url.host # pyright: ignore[reportReturnType] |
Contributor
Author
There was a problem hiding this comment.
cc @Viicos, using more explicit ignores :)
sydney-runkle
commented
Nov 15, 2024
Comment on lines
-490
to
-494
| @property | ||
| def host(self) -> str: | ||
| """The required URL host.""" | ||
| return self._url.host # type: ignore | ||
|
|
Contributor
Author
There was a problem hiding this comment.
We can remove the added host specs that overrode the str | None return type from _BaseUrl, as AnyUrl enforces str
sydney-runkle
commented
Nov 15, 2024
Comment on lines
+610
to
+614
| @property | ||
| def host(self) -> str | None: # pyright: ignore[reportIncompatibleMethodOverride] | ||
| """The host part of the URL, or `None`.""" | ||
| return self._url.host | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Have to add this for the case where host_required=Fals because AnyUrl has host typed as str, so we indicate the optional nature here.
CodSpeed Performance ReportMerging #10856 will not alter performanceComparing Summary
|
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
davidhewitt
approved these changes
Nov 18, 2024
Collaborator
davidhewitt
left a comment
There was a problem hiding this comment.
Based on the surrounding discussion, this makes sense to me 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses concerns from #10783 (comment)