Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Subclass all single host url classes fromAnyUrl
to preserve behavior from v2.9#10856
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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 |
@@ -475,10 +475,14 @@ class AnyUrl(_BaseUrl): | |||
@property | |||
def host(self) -> str: | |||
"""The required URL host.""" | |||
return self._url.host # type: ignore | |||
return self._url.host # pyright: ignore[reportReturnType] |
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.
cc@Viicos, using more explicit ignores :)
@property | ||
def host(self) -> str: | ||
"""The required URL host.""" | ||
return self._url.host # type: ignore | ||
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.
We can remove the addedhost
specs that overrode thestr | None
return type from_BaseUrl
, asAnyUrl
enforcesstr
@property | ||
def host(self) -> str | None: # pyright: ignore[reportIncompatibleMethodOverride] | ||
"""The host part of the URL, or `None`.""" | ||
return self._url.host | ||
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.
Have to add this for the case wherehost_required=Fals
becauseAnyUrl
hashost
typed asstr
, so we indicate the optional nature here.
CodSpeed Performance ReportMerging#10856 willnot alter performanceComparing Summary
|
Coverage reportClick to see where and how coverage changed
This report was generated bypython-coverage-comment-action |
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.
Based on the surrounding discussion, this makes sense to me 👍
372d4e2
intomainUh oh!
There was an error while loading.Please reload this page.
Addresses concerns from#10783 (comment)