[py] fix incompatible types in `url_to_be()` function
User description
Thanks for contributing to Selenium! A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines. Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Fixes #13544
The url_to_be() function had an incompatible type as reported by mypy.
We can change the any_of() function params to make it compatible.
Motivation and Context
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue) fixes #13544
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [x] I have read the contributing document.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [x] All new and existing tests passed.
PR Type
Bug fix
Description
- Fixed incompatible types in the
url_to_befunction as reported bymypy. - Updated the return type of the
url_to_befunction to includeUnion[bool, List[WebElement], WebElement, Literal[False]]. - Modified the
_predicatefunction to returnLiteral[False]if the URL does not match.
Changes walkthrough 📝
| Relevant files | |||
|---|---|---|---|
| Bug fix |
|
💡 PR-Agent usage: Comment
/helpon the PR to get a list of all available PR-Agent tools and their descriptions
PR Reviewer Guide 🔍
| ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪ |
| 🧪 No relevant tests |
| 🔒 No security concerns identified |
| ⚡ Key issues to review Incorrect Return Type |
PR Code Suggestions ✨
| Category | Suggestion | Score |
| Possible issue |
✅ Simplify the return statement by using
| 9 |
Moving to draft as it needs clarification from issue author - https://github.com/SeleniumHQ/selenium/issues/13544