You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains 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
Incorrect Return Type The use of Literal[False] in the return type of _predicate function is incorrect. It should be bool instead, as Literal[False] is not a valid return type and does not make sense in this context. The correct return type should be bool to indicate a true or false condition.
✅ Simplify the return statement by using False instead of Literal[False]Suggestion Impact:The suggestion to replace `Literal[False]` with `False` in the return statement was implemented in the commit.
code diff:
- return url == driver.current_url or Literal[False]+ return url == driver.current_url or False
Replace the use of Literal[False] with False in the return statement. Literal[False] is not necessary and can be replaced with the boolean value False directly for clarity and correctness.
-return url == driver.current_url or Literal[False]+return url == driver.current_url or False
Apply this suggestion
Suggestion importance[1-10]: 9
Why: The suggestion improves code clarity and correctness by replacing Literal[False] with the boolean value False, which is more appropriate in this context.
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.
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 bymypy
.We can change the
any_of()
function params to make it compatible.Motivation and Context
Types of changes
Checklist
PR Type
Bug fix
Description
url_to_be
function as reported bymypy
.url_to_be
function to includeUnion[bool, List[WebElement], WebElement, Literal[False]]
._predicate
function to returnLiteral[False]
if the URL does not match.Changes walkthrough 📝
expected_conditions.py
Fix incompatible return types in `url_to_be` function
py/selenium/webdriver/support/expected_conditions.py
url_to_be
function to include multiplepossible types.
_predicate
function to returnLiteral[False]
if the URLdoes not match.