[py] chore fix for unreachable mypy warnings - #17969
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
Pull request overview
This PR tightens Python typing annotations and updates the Python mypy configuration to eliminate “unreachable” warnings, aligning the bindings with stricter static analysis while keeping runtime behavior effectively unchanged.
Changes:
- Enable
warn_unreachableinpy/pyproject.tomland remove an unused mypy override entry. - Add/adjust type annotations in several Python binding modules to make previously “unreachable” branches type-reachable (e.g.,
Proxy.noProxy,Proxy.socksVersion, pointer moveorigin, FirefoxLog.level). - Simplify
Service.stop()log handle closing logic to avoid mypy “unreachable” diagnostics while preserving ownership-based closing behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| py/selenium/webdriver/firefox/options.py | Annotates Log.level as `str |
| py/selenium/webdriver/common/service.py | Adjusts log output closing logic to avoid mypy unreachable analysis while keeping owned-resource cleanup. |
| py/selenium/webdriver/common/proxy.py | Annotates proxy fields (noProxy, socksVersion, etc.) so BiDi conversion branches are type-reachable. |
| py/selenium/webdriver/common/actions/pointer_input.py | Widens origin to `WebElement |
| py/pyproject.toml | Enables unreachable warnings and removes an unused mypy override section. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history |
🔗 Related Issues
💥 What does this PR do?
PR fixes warnings for mypy checks
🔧 Implementation Notes
🤖 AI assistance
💡 Additional Considerations
🔄 Types of changes