Skip to content

use Self from typing_extensions #3364

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

Merged
merged 2 commits into from
Mar 17, 2024
Merged

use Self from typing_extensions #3364

merged 2 commits into from
Mar 17, 2024

Conversation

asottile
Copy link
Contributor

resolves #3363

illia-v
illia-v previously approved these changes Mar 17, 2024
Copy link
Member

@illia-v illia-v left a comment

Choose a reason for hiding this comment

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

Thanks @asottile!

New usage of Self coincides with https://typing.readthedocs.io/en/latest/spec/generics.html#valid-locations-for-self, one little nit is about the tense in the news entry.

@illia-v illia-v merged commit cc892b0 into urllib3:main Mar 17, 2024
@asottile asottile deleted the self-type branch March 20, 2024 13:29
@@ -462,7 +462,7 @@ def __ior__(self, other: object) -> HTTPHeaderDict:
self.extend(maybe_constructable)
return self

def __or__(self, other: object) -> HTTPHeaderDict:
def __or__(self, other: object) -> Self:
Copy link
Contributor

Choose a reason for hiding this comment

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

@asottile Why not also on __ior__ above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I seem to remember it generated an error on a subclass so I skipped it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

imprecise types on urllib3.Retry.new / urllib3.Retry.increment
4 participants