[py] Use Self as return type of __enter__ in remote.WebDriver#17170
Merged
cgoldberg merged 1 commit intoMar 3, 2026
Merged
Conversation
Contributor
Review Summary by QodoUse
WalkthroughsDescription• Changes __enter__ return type from WebDriver to Self • Enables proper type inference for context manager usage • Imports Self from typing_extensions for Python 3.10 compatibility File Changes1. py/selenium/webdriver/remote/webdriver.py
|
Contributor
Code Review by Qodo
1. No test for __enter__ typing
|
Self as return type of __enter__
Member
|
CI is going to fail on this branch because of a bug in Firefox beta.. it's unrelated to this PR. |
AutomatedTester
pushed a commit
that referenced
this pull request
Mar 11, 2026
This was referenced Apr 9, 2026
This was referenced Apr 13, 2026
This was referenced Apr 20, 2026
Chore: Bump Microsoft.AspNetCore.Cryptography.KeyDerivation and 13 others
Whisparr/Whisparr-Eros#280
Closed
This was referenced May 1, 2026
This was referenced May 11, 2026
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.
🔗 Related Issues
Fixes #17169
💥 What does this PR do?
change the return type of
s.w.remote.webdriver.WebDriver.__enter__froms.w.remote.webdriver.WebDrivertoSelf.as a result,
drv.get_login the following code can be resolved as expected.🔧 Implementation Notes
since selenium currently supports Python 3.10, i used
typing_extensions.Selfinstead oftyping.Self.💡 Additional Considerations
🔄 Types of changes