-
- Notifications
You must be signed in to change notification settings - Fork 8.6k
Closed
Labels
C-pyPython BindingsPython BindingsI-defectSomething is not working as intendedSomething is not working as intendedR-help wantedIssues looking for contributionsIssues looking for contributionsgood first issueGood first issue for new contributors to start withGood first issue for new contributors to start with
Description
Description
The following error from mypy occurs for WebDriverWait.__repr__
error: Item "WebElement" of the upper bound "WebDriver | WebElement" of type variable "D" has no attribute "session_id" [union-attr]
Explanation:
If you pass a WebElement into WebDriverWait, the repr will not be able to properly access the session_id attribute. Mypy is detecting this.
def __repr__(self): return f'<{type(self).__module__}.{type(self).__name__} (session="{self._driver.session_id}")>'My guess is there likely needs to be additional logic to access driver from WebElement.parent in those cases, or session_id needs to be exposed as an attribute of WebElement.
Reproducible Code
def __repr__(self): return f'<{type(self).__module__}.{type(self).__name__} (session="{self._driver.session_id}")>'Metadata
Metadata
Assignees
Labels
C-pyPython BindingsPython BindingsI-defectSomething is not working as intendedSomething is not working as intendedR-help wantedIssues looking for contributionsIssues looking for contributionsgood first issueGood first issue for new contributors to start withGood first issue for new contributors to start with