Use ConvertibleToInt/ConvertibleToFloat in many third-party stubs (#11022)

Note: this may make the latest version of certain stubs packages incompatible with older versions of mypy and pyright.
This commit is contained in:
Avasam
2023-11-29 06:23:00 -05:00
committed by GitHub
parent 09668963a1
commit 4687faab8e
80 changed files with 831 additions and 970 deletions

View File

@@ -1,8 +1,8 @@
import sys
from _typeshed import Incomplete, ReadableBuffer, StrOrBytesPath, Unused
from _typeshed import ConvertibleToFloat, Incomplete, StrOrBytesPath, Unused
from collections.abc import Callable, Generator
from typing import NamedTuple, SupportsFloat, TypeVar, overload
from typing_extensions import Final, ParamSpec, SupportsIndex, TypeAlias
from typing import NamedTuple, TypeVar, overload
from typing_extensions import Final, ParamSpec, TypeAlias
from PIL import Image
@@ -56,7 +56,7 @@ def locate(
limit: Unused = 1,
region: tuple[int, int, int, int] | None = None,
step: int = 1,
confidence: SupportsFloat | SupportsIndex | str | ReadableBuffer = 0.999,
confidence: ConvertibleToFloat = 0.999,
) -> Box | None: ...
# _locateAll_pillow
@@ -82,7 +82,7 @@ def locateOnScreen(
limit: Unused = 1,
region: tuple[int, int, int, int] | None = None,
step: int = 1,
confidence: SupportsFloat | SupportsIndex | str | ReadableBuffer = 0.999,
confidence: ConvertibleToFloat = 0.999,
) -> Box | None: ...
# _locateAll_pillow
@@ -107,7 +107,7 @@ def locateAllOnScreen(
limit: int = 1000,
region: tuple[int, int, int, int] | None = None,
step: int = 1,
confidence: SupportsFloat | SupportsIndex | str | ReadableBuffer = 0.999,
confidence: ConvertibleToFloat = 0.999,
) -> Generator[Box, None, None]: ...
# _locateAll_pillow
@@ -132,7 +132,7 @@ def locateCenterOnScreen(
limit: Unused = 1,
region: tuple[int, int, int, int] | None = None,
step: int = 1,
confidence: SupportsFloat | SupportsIndex | str | ReadableBuffer = 0.999,
confidence: ConvertibleToFloat = 0.999,
) -> Point | None: ...
# _locateAll_pillow
@@ -159,7 +159,7 @@ def locateOnWindow(
grayscale: bool | None = None,
limit: Unused = 1,
step: int = 1,
confidence: SupportsFloat | SupportsIndex | str | ReadableBuffer = 0.999,
confidence: ConvertibleToFloat = 0.999,
) -> Box | None: ...
# _locateAll_pillow
@@ -201,7 +201,7 @@ def locateAll(
limit: int = 1000,
region: tuple[int, int, int, int] | None = None,
step: int = 1,
confidence: SupportsFloat | SupportsIndex | str | ReadableBuffer = 0.999,
confidence: ConvertibleToFloat = 0.999,
) -> Generator[Box, None, None]: ...
# _locateAll_pillow