diff --git a/stdlib/distutils/filelist.pyi b/stdlib/distutils/filelist.pyi index 361cb13f0..d8b87e251 100644 --- a/stdlib/distutils/filelist.pyi +++ b/stdlib/distutils/filelist.pyi @@ -17,34 +17,34 @@ class FileList: def process_template_line(self, line: str) -> None: ... @overload def include_pattern( - self, pattern: str, anchor: int | bool = ..., prefix: str | None = ..., is_regex: Literal[0, False] = ... + self, pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[0, False] = ... ) -> bool: ... @overload def include_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> bool: ... @overload def include_pattern( - self, pattern: str | Pattern[str], anchor: int | bool = ..., prefix: str | None = ..., is_regex: int | bool = ... + self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... ) -> bool: ... @overload def exclude_pattern( - self, pattern: str, anchor: int | bool = ..., prefix: str | None = ..., is_regex: Literal[0, False] = ... + self, pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[0, False] = ... ) -> bool: ... @overload def exclude_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> bool: ... @overload def exclude_pattern( - self, pattern: str | Pattern[str], anchor: int | bool = ..., prefix: str | None = ..., is_regex: int | bool = ... + self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... ) -> bool: ... def findall(dir: str = ...) -> list[str]: ... def glob_to_re(pattern: str) -> str: ... @overload def translate_pattern( - pattern: str, anchor: int | bool = ..., prefix: str | None = ..., is_regex: Literal[False, 0] = ... + pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[False, 0] = ... ) -> Pattern[str]: ... @overload def translate_pattern(pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> Pattern[str]: ... @overload def translate_pattern( - pattern: str | Pattern[str], anchor: int | bool = ..., prefix: str | None = ..., is_regex: int | bool = ... + pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... ) -> Pattern[str]: ... diff --git a/stdlib/filecmp.pyi b/stdlib/filecmp.pyi index a6747dd50..4c8169275 100644 --- a/stdlib/filecmp.pyi +++ b/stdlib/filecmp.pyi @@ -13,12 +13,12 @@ __all__ = ["clear_cache", "cmp", "dircmp", "cmpfiles", "DEFAULT_IGNORES"] DEFAULT_IGNORES: list[str] BUFSIZE: Literal[8192] -def cmp(f1: StrOrBytesPath, f2: StrOrBytesPath, shallow: int | bool = ...) -> bool: ... +def cmp(f1: StrOrBytesPath, f2: StrOrBytesPath, shallow: bool | Literal[0, 1] = ...) -> bool: ... def cmpfiles( a: AnyStr | PathLike[AnyStr], b: AnyStr | PathLike[AnyStr], common: Iterable[AnyStr | PathLike[AnyStr]], - shallow: int | bool = ..., + shallow: bool | Literal[0, 1] = ..., ) -> tuple[list[AnyStr], list[AnyStr], list[AnyStr]]: ... class dircmp(Generic[AnyStr]): diff --git a/stdlib/fractions.pyi b/stdlib/fractions.pyi index 0d787a011..d7bd92125 100644 --- a/stdlib/fractions.pyi +++ b/stdlib/fractions.pyi @@ -118,7 +118,7 @@ class Fraction(Rational): @overload def __pow__(self, b: complex) -> complex: ... @overload - def __rpow__(self, a: int | float | Fraction) -> float: ... + def __rpow__(self, a: float | Fraction) -> float: ... @overload def __rpow__(self, a: complex) -> complex: ... def __pos__(self) -> Fraction: ... diff --git a/stdlib/ftplib.pyi b/stdlib/ftplib.pyi index 925ad5884..49c680a6f 100644 --- a/stdlib/ftplib.pyi +++ b/stdlib/ftplib.pyi @@ -70,7 +70,7 @@ class FTP: def getwelcome(self) -> str: ... def set_debuglevel(self, level: int) -> None: ... def debug(self, level: int) -> None: ... - def set_pasv(self, val: bool | int) -> None: ... + def set_pasv(self, val: bool | Literal[0, 1]) -> None: ... def sanitize(self, s: str) -> str: ... def putline(self, line: str) -> None: ... def putcmd(self, line: str) -> None: ... diff --git a/stdlib/itertools.pyi b/stdlib/itertools.pyi index 43a0e8038..7299ee820 100644 --- a/stdlib/itertools.pyi +++ b/stdlib/itertools.pyi @@ -18,7 +18,7 @@ _T4 = TypeVar("_T4") _T5 = TypeVar("_T5") _T6 = TypeVar("_T6") -_Step: TypeAlias = int | float | SupportsFloat | SupportsInt | SupportsIndex | SupportsComplex +_Step: TypeAlias = SupportsFloat | SupportsInt | SupportsIndex | SupportsComplex _Predicate: TypeAlias = Callable[[_T], object] diff --git a/stdlib/locale.pyi b/stdlib/locale.pyi index 2c4959843..1a1da8231 100644 --- a/stdlib/locale.pyi +++ b/stdlib/locale.pyi @@ -126,7 +126,7 @@ if sys.version_info >= (3, 7): else: def format_string(f: _str, val: Any, grouping: bool = ...) -> _str: ... -def currency(val: int | float | Decimal, symbol: bool = ..., grouping: bool = ..., international: bool = ...) -> _str: ... +def currency(val: float | Decimal, symbol: bool = ..., grouping: bool = ..., international: bool = ...) -> _str: ... def delocalize(string: _str) -> _str: ... def atof(string: _str, func: Callable[[_str], float] = ...) -> float: ... def atoi(string: _str) -> int: ... diff --git a/stdlib/random.pyi b/stdlib/random.pyi index 255436dc3..12039af7c 100644 --- a/stdlib/random.pyi +++ b/stdlib/random.pyi @@ -68,7 +68,7 @@ class Random(_random.Random): def __init__(self, x: Any = ...) -> None: ... # Using other `seed` types is deprecated since 3.9 and removed in 3.11 if sys.version_info >= (3, 9): - def seed(self, a: int | float | str | bytes | bytearray | None = ..., version: int = ...) -> None: ... # type: ignore[override] + def seed(self, a: float | str | bytes | bytearray | None = ..., version: int = ...) -> None: ... # type: ignore[override] else: def seed(self, a: Any = ..., version: int = ...) -> None: ... diff --git a/stdlib/turtle.pyi b/stdlib/turtle.pyi index 3e91a5eb0..e0a6b816c 100644 --- a/stdlib/turtle.pyi +++ b/stdlib/turtle.pyi @@ -410,7 +410,11 @@ class _Screen(TurtleScreen): def __init__(self) -> None: ... # Note int and float are interpreted differently, hence the Union instead of just float def setup( - self, width: int | float = ..., height: int | float = ..., startx: int | None = ..., starty: int | None = ... + self, + width: int | float = ..., # noqa: Y041 + height: int | float = ..., # noqa: Y041 + startx: int | None = ..., + starty: int | None = ..., ) -> None: ... def title(self, titlestring: str) -> None: ... def bye(self) -> None: ... diff --git a/stubs/filelock/filelock/__init__.pyi b/stubs/filelock/filelock/__init__.pyi index 1d66887f1..c17e3319f 100644 --- a/stubs/filelock/filelock/__init__.pyi +++ b/stubs/filelock/filelock/__init__.pyi @@ -13,13 +13,13 @@ class _Acquire_ReturnProxy: ) -> None: ... class BaseFileLock: - def __init__(self, lock_file: str, timeout: float | int | str = ...) -> None: ... + def __init__(self, lock_file: str, timeout: float | str = ...) -> None: ... @property def lock_file(self) -> str: ... @property def timeout(self) -> float: ... @timeout.setter - def timeout(self, value: int | str | float) -> None: ... # type: ignore + def timeout(self, value: str | float) -> None: ... # type: ignore @property def is_locked(self) -> bool: ... def acquire(self, timeout: float | None = ..., poll_intervall: float = ...) -> _Acquire_ReturnProxy: ... diff --git a/stubs/opentracing/opentracing/mocktracer/span.pyi b/stubs/opentracing/opentracing/mocktracer/span.pyi index da419aa7a..a54b4d636 100644 --- a/stubs/opentracing/opentracing/mocktracer/span.pyi +++ b/stubs/opentracing/opentracing/mocktracer/span.pyi @@ -28,7 +28,7 @@ class MockSpan(Span): @property def context(self) -> SpanContext: ... def set_operation_name(self: Self, operation_name: str) -> Self: ... - def set_tag(self: Self, key: str, value: str | bool | int | float) -> Self: ... + def set_tag(self: Self, key: str, value: str | bool | float) -> Self: ... def log_kv(self: Self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ... def set_baggage_item(self: Self, key: str, value: str) -> Self: ... diff --git a/stubs/opentracing/opentracing/span.pyi b/stubs/opentracing/opentracing/span.pyi index 3f9685adb..d4ccb201d 100644 --- a/stubs/opentracing/opentracing/span.pyi +++ b/stubs/opentracing/opentracing/span.pyi @@ -17,7 +17,7 @@ class Span: def tracer(self) -> Tracer: ... def set_operation_name(self: Self, operation_name: str) -> Self: ... def finish(self, finish_time: float | None = ...) -> None: ... - def set_tag(self: Self, key: str, value: str | bool | int | float) -> Self: ... + def set_tag(self: Self, key: str, value: str | bool | float) -> Self: ... def log_kv(self: Self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ... def set_baggage_item(self: Self, key: str, value: str) -> Self: ... def get_baggage_item(self, key: str) -> str | None: ... diff --git a/stubs/protobuf/google/protobuf/internal/containers.pyi b/stubs/protobuf/google/protobuf/internal/containers.pyi index d43425b4c..72184e3bc 100644 --- a/stubs/protobuf/google/protobuf/internal/containers.pyi +++ b/stubs/protobuf/google/protobuf/internal/containers.pyi @@ -10,7 +10,7 @@ from google.protobuf.message import Message _T = TypeVar("_T") _K = TypeVar("_K", bound=bool | int | str) -_ScalarV = TypeVar("_ScalarV", bound=bool | int | float | str | bytes) +_ScalarV = TypeVar("_ScalarV", bound=bool | float | str | bytes) _MessageV = TypeVar("_MessageV", bound=Message) _M = TypeVar("_M") diff --git a/stubs/protobuf/google/protobuf/internal/extension_dict.pyi b/stubs/protobuf/google/protobuf/internal/extension_dict.pyi index 518c36b24..ecf56a360 100644 --- a/stubs/protobuf/google/protobuf/internal/extension_dict.pyi +++ b/stubs/protobuf/google/protobuf/internal/extension_dict.pyi @@ -8,7 +8,7 @@ from google.protobuf.message import Message _ContainerMessageT = TypeVar("_ContainerMessageT", bound=Message) _ExtenderMessageT = TypeVar( "_ExtenderMessageT", - bound=Message | RepeatedScalarFieldContainer[Any] | RepeatedCompositeFieldContainer[Any] | bool | int | float | str | bytes, + bound=Message | RepeatedScalarFieldContainer[Any] | RepeatedCompositeFieldContainer[Any] | bool | float | str | bytes, ) class _ExtensionFieldDescriptor(FieldDescriptor, Generic[_ContainerMessageT, _ExtenderMessageT]): ... diff --git a/stubs/pyaudio/pyaudio.pyi b/stubs/pyaudio/pyaudio.pyi index a08d6cbf4..d773029df 100644 --- a/stubs/pyaudio/pyaudio.pyi +++ b/stubs/pyaudio/pyaudio.pyi @@ -69,7 +69,7 @@ paMacCoreStreamInfo: PaMacCoreStreamInfo # Auxiliary types _ChannelMap: TypeAlias = Sequence[int] _PaHostApiInfo: TypeAlias = Mapping[str, str | int] -_PaDeviceInfo: TypeAlias = Mapping[str, str | int | float] +_PaDeviceInfo: TypeAlias = Mapping[str, str | float] _StreamCallback: TypeAlias = Callable[[bytes | None, int, Mapping[str, float], int], tuple[bytes | None, int]] def get_format_from_width(width: int, unsigned: bool = ...) -> int: ... diff --git a/stubs/redis/redis/lock.pyi b/stubs/redis/redis/lock.pyi index 7fad1f11a..819837769 100644 --- a/stubs/redis/redis/lock.pyi +++ b/stubs/redis/redis/lock.pyi @@ -31,14 +31,14 @@ class Lock: self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None ) -> bool | None: ... def acquire( - self, blocking: bool | None = ..., blocking_timeout: None | int | float = ..., token: str | bytes | None = ... + self, blocking: bool | None = ..., blocking_timeout: float | None = ..., token: str | bytes | None = ... ) -> bool: ... def do_acquire(self, token: str | bytes) -> bool: ... def locked(self) -> bool: ... def owned(self) -> bool: ... def release(self) -> None: ... def do_release(self, expected_token: str | bytes) -> None: ... - def extend(self, additional_time: int | float, replace_ttl: bool = ...) -> bool: ... - def do_extend(self, additional_time: int | float, replace_ttl: bool) -> bool: ... + def extend(self, additional_time: float, replace_ttl: bool = ...) -> bool: ... + def do_extend(self, additional_time: float, replace_ttl: bool) -> bool: ... def reacquire(self) -> bool: ... def do_reacquire(self) -> bool: ... diff --git a/stubs/typed-ast/typed_ast/ast27.pyi b/stubs/typed-ast/typed_ast/ast27.pyi index 977bba196..de926f0f2 100644 --- a/stubs/typed-ast/typed_ast/ast27.pyi +++ b/stubs/typed-ast/typed_ast/ast27.pyi @@ -237,7 +237,7 @@ class Repr(expr): value: expr class Num(expr): - n: int | float | complex + n: complex class Str(expr): s: str | bytes diff --git a/stubs/typed-ast/typed_ast/ast3.pyi b/stubs/typed-ast/typed_ast/ast3.pyi index 0d01e499a..58e2e5f8b 100644 --- a/stubs/typed-ast/typed_ast/ast3.pyi +++ b/stubs/typed-ast/typed_ast/ast3.pyi @@ -252,7 +252,7 @@ class Call(expr): keywords: list[keyword] class Num(expr): - n: float | int | complex + n: complex class Str(expr): s: str