-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruff q-z #46
Ruff q-z #46
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,16 @@ | |
|
||
from __future__ import annotations | ||
|
||
from typing import Type, TypeVar | ||
from typing import TYPE_CHECKING, TypeVar | ||
|
||
from screenpy.actor import Actor | ||
from screenpy.exceptions import DeliveryError | ||
from screenpy.pacing import beat | ||
from selenium.common.exceptions import WebDriverException | ||
|
||
from ..target import Target | ||
if TYPE_CHECKING: | ||
from screenpy.actor import Actor | ||
|
||
from ..target import Target | ||
|
||
SelfClear = TypeVar("SelfClear", bound="Clear") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can actually move these I don't have strong opinions on it, but i do like that all the type checking stuff is contained within that block that way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm about to yank all of those typevars out after the ruff changes. |
||
|
||
|
@@ -26,7 +28,7 @@ class Clear: | |
""" | ||
|
||
@classmethod | ||
def the_text_from_the(cls: Type[SelfClear], target: Target) -> SelfClear: | ||
def the_text_from_the(cls: type[SelfClear], target: Target) -> SelfClear: | ||
""" | ||
Specify the Target from which to clear the text. | ||
|
||
|
@@ -37,13 +39,13 @@ def the_text_from_the(cls: Type[SelfClear], target: Target) -> SelfClear: | |
return cls(target=target) | ||
|
||
@classmethod | ||
def the_text_from(cls: Type[SelfClear], target: Target) -> SelfClear: | ||
def the_text_from(cls: type[SelfClear], target: Target) -> SelfClear: | ||
"""Alias for :meth:`~screenpy_selenium.actions.Clear.the_text_from_the`.""" | ||
return cls.the_text_from_the(target=target) | ||
|
||
@classmethod | ||
def the_text_from_the_first_of_the( | ||
cls: Type[SelfClear], target: Target | ||
cls: type[SelfClear], target: Target | ||
) -> SelfClear: | ||
"""Alias for :meth:`~screenpy_selenium.actions.Clear.the_text_from_the`.""" | ||
return cls.the_text_from_the(target=target) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉