fix: fix type checker errors for pyright by ilotoki0804 · Pull Request #1203 · appium/python-client

@ilotoki0804

For a more detailed explanation, please refer to this link.

@ilotoki0804

@ilotoki0804

@linux-foundation-easycla

mykola-mokhnach

@ilotoki0804

Added deprecation warnings for unimplemented methods in CanExecuteScripts protocol.

mykola-mokhnach


from typing import Any, List, Optional, Protocol
from typing import Any, List, Optional, Protocol, TYPE_CHECKING
from warings import deprecated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warings?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opps😅

mykola-mokhnach

# 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")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather say is deprecated for removal

Choose a reason for hiding this comment

The 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.

Choose a reason for hiding this comment

The 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

@ilotoki0804

KazuCocoa

Appium Python Client: WebDriver module
"""

__all__ = ["Remote", "WebElement"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks reasonable to me. This fixes mypy --strict also.

@ilotoki0804

@ilotoki0804

KazuCocoa

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lg to me. Waiting for the CI result

@KazuCocoa KazuCocoa changed the title fix: Fix type checker errors fix: fix type checker errors for pyright

Mar 5, 2026

KazuCocoa