-
Notifications
You must be signed in to change notification settings - Fork 569
fix: fix type checker errors for pyright #1203
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
Changes from 3 commits
5e0b420
8b1ed55
8228005
1e3475b
024f74f
5ee2faa
3354542
32400fc
35f3e0d
1949373
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 |
|---|---|---|
|
|
@@ -12,16 +12,24 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from typing import Any, List, Optional, Protocol | ||
| from typing import Any, List, Optional, Protocol, TYPE_CHECKING | ||
| from warings import deprecated | ||
|
|
||
|
|
||
| class CanExecuteScripts(Protocol): | ||
| def pin_script(self, script: str, script_key: Optional[Any] = None) -> Any: ... | ||
|
KazuCocoa marked this conversation as resolved.
|
||
| def execute_script(self, script: str, *args: Any) -> Any: ... | ||
|
|
||
| def unpin(self, script_key: Any) -> None: ... | ||
| # TODO: remove `if not TYPE_CHECKING` guard after properly implement them | ||
| # The use of these methods will produce DeprecationWarnings at runtime | ||
| if not TYPE_CHECKING: | ||
| @deprecated("pin_script is not yet implemented") | ||
|
Contributor
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 would rather say
Contributor
Author
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 assumed those methods would be implemented later. If there are no plans to do so, I will make the changes as you suggested.
Contributor
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 am not sure it makes sense to implement them in mobile context, but it still makes sense to confirm that with other maintainers |
||
| def pin_script(self, script: str, script_key: Optional[Any] = None) -> Any: ... | ||
|
|
||
| def get_pinned_scripts(self) -> List[str]: ... | ||
| @deprecated("unpin is not yet implemented") | ||
| def unpin(self, script_key: Any) -> None: ... | ||
|
|
||
| def execute_script(self, script: str, *args: Any) -> Any: ... | ||
| @deprecated("get_pinned_scripts is not yet implemented") | ||
| def get_pinned_scripts(self) -> List[str]: ... | ||
|
|
||
| def execute_async_script(self, script: str, *args: Any) -> Any: ... | ||
| @deprecated("execute_async_script is not yet implemented") | ||
| def execute_async_script(self, script: str, *args: Any) -> Any: ... | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,5 +16,7 @@ | |
| Appium Python Client: WebDriver module | ||
| """ | ||
|
|
||
| __all__ = ["Remote", "WebElement"] | ||
|
Member
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. This change looks reasonable to me. This fixes |
||
|
|
||
| from .webdriver import WebDriver as Remote | ||
| from .webelement import WebElement | ||
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.
warings?
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.
Opps😅