diff --git a/stubs/PyAutoGUI/pyautogui/__init__.pyi b/stubs/PyAutoGUI/pyautogui/__init__.pyi index c00379e3746a..423b4096d2f7 100644 --- a/stubs/PyAutoGUI/pyautogui/__init__.pyi +++ b/stubs/PyAutoGUI/pyautogui/__init__.pyi @@ -1,4 +1,5 @@ import contextlib +from _typeshed import ConvertibleToInt from collections.abc import Callable, Iterable, Sequence from datetime import datetime from typing import NamedTuple, SupportsInt, TypeVar @@ -19,7 +20,10 @@ from pyscreeze import ( _P = ParamSpec("_P") _R = TypeVar("_R") -_NormalizeableXArg: TypeAlias = str | SupportsInt | Sequence[SupportsInt] +# Explicitly mentioning str despite being in the ConvertibleToInt Alias because it has a different meaning (filename on screen) +# Specifying non-None Y arg when X is a string or sequence raises an error +# TODO: This could be better represented through overloads +_NormalizeableXArg: TypeAlias = str | ConvertibleToInt | Sequence[ConvertibleToInt] # Constants KEY_NAMES: list[str] diff --git a/stubs/netaddr/netaddr/eui/__init__.pyi b/stubs/netaddr/netaddr/eui/__init__.pyi index 4dccd927a1d8..a2f0e4660464 100644 --- a/stubs/netaddr/netaddr/eui/__init__.pyi +++ b/stubs/netaddr/netaddr/eui/__init__.pyi @@ -1,5 +1,6 @@ -from typing import ClassVar, SupportsInt, overload -from typing_extensions import Literal, Self, SupportsIndex +from _typeshed import ConvertibleToInt +from typing import ClassVar, overload +from typing_extensions import Literal, Self from netaddr.core import DictDotLookup from netaddr.ip import IPAddress @@ -40,7 +41,7 @@ class EUI(BaseIdentifier): @property def value(self) -> int: ... @value.setter - def value(self, value: str | SupportsInt | SupportsIndex) -> None: ... + def value(self, value: ConvertibleToInt) -> None: ... @property def dialect(self) -> type[mac_eui48 | eui64_base]: ... @dialect.setter @@ -77,7 +78,7 @@ class EUI(BaseIdentifier): def bin(self) -> str: ... def eui64(self) -> Self: ... def modified_eui64(self) -> Self: ... - def ipv6(self, prefix: str | SupportsInt | SupportsIndex) -> IPAddress: ... + def ipv6(self, prefix: ConvertibleToInt) -> IPAddress: ... def ipv6_link_local(self) -> IPAddress: ... @property def info(self) -> DictDotLookup: ... diff --git a/stubs/netaddr/netaddr/ip/__init__.pyi b/stubs/netaddr/netaddr/ip/__init__.pyi index 58a921df17a4..97d9588a2b52 100644 --- a/stubs/netaddr/netaddr/ip/__init__.pyi +++ b/stubs/netaddr/netaddr/ip/__init__.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete, Unused +from _typeshed import ConvertibleToInt, Incomplete, Unused from abc import abstractmethod from collections.abc import Iterable, Iterator from typing import SupportsInt, overload @@ -71,9 +71,9 @@ class IPAddress(BaseIP): def ipv4(self) -> Self: ... def ipv6(self, ipv4_compatible: bool = False) -> Self: ... def format(self, dialect: type[ipv6_verbose] | None = None) -> str: ... - def __or__(self, other: str | SupportsInt | SupportsIndex) -> Self: ... - def __and__(self, other: str | SupportsInt | SupportsIndex) -> Self: ... - def __xor__(self, other: str | SupportsInt | SupportsIndex) -> Self: ... + def __or__(self, other: SupportsInt | SupportsIndex) -> Self: ... + def __and__(self, other: SupportsInt | SupportsIndex) -> Self: ... + def __xor__(self, other: SupportsInt | SupportsIndex) -> Self: ... def __lshift__(self, numbits: int) -> Self: ... def __rshift__(self, numbits: int) -> Self: ... def __bool__(self) -> bool: ... @@ -148,7 +148,7 @@ class IPRange(BaseIP, IPListMixin): def cidrs(self) -> list[IPNetwork]: ... def iter_unique_ips(*args: IPRange | _IPNetworkAddr) -> Iterator[IPAddress]: ... -def cidr_abbrev_to_verbose(abbrev_cidr: str | SupportsInt | SupportsIndex) -> str: ... +def cidr_abbrev_to_verbose(abbrev_cidr: ConvertibleToInt) -> str: ... def cidr_merge(ip_addrs: Iterable[IPRange | _IPNetworkAddr]) -> list[IPNetwork]: ... def cidr_exclude(target: _IPNetworkAddr, exclude: _IPNetworkAddr) -> list[IPNetwork]: ... def cidr_partition(