From dbfc87987afa4de4df0cd7e9c23a6c0250760d4b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 1 Oct 2026 04:39:38 +0000 Subject: [PATCH 1/2] Update most test/lint dependencies --- .pre-commit-config.yaml | 8 ++++---- requirements-tests.txt | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3733c84f6b76..8a97496eb3e6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,14 +11,14 @@ repos: args: [--fix=lf] - id: check-case-conflict - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 12e63946db2c5cfcc9030fac21c3883ba88c6ed8 # frozen: 0.38.0 + rev: 0494aa7fa1314e98913a41227d8f0a515b2c1049 # frozen: 0.38.2 hooks: - id: check-github-workflows - id: check-renovate additional_dependencies: ["json5==0.15.0"] - repo: https://github.com/astral-sh/ruff-pre-commit # The Ruff version must match requirements-tests.txt. - rev: c59bba8fb259db0fec2bbb77ad8ba51ea7341b56 # frozen: v0.15.20 + rev: 2eeb5678de71a00c0902cbda7105d328432f72cb # frozen: v0.16.8 hooks: - id: ruff name: Run ruff on stubs, tests and scripts @@ -38,7 +38,7 @@ repos: hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: c48217e1fc006c2dddd14df54e83b67da15de5cd # frozen: 7.3.0 + rev: 7eccf20b526fe4f2230bf9afeeef2fc9f97faf8d # frozen: 7.4.1 hooks: - id: flake8 language: python @@ -51,7 +51,7 @@ repos: - id: check-hooks-apply # zizmor detects security vulnerabilities in GitHub Actions workflows. - repo: https://github.com/zizmorcore/zizmor-pre-commit - rev: 451b56af716f9f0d0c2b816503a3fd0cf8b036fa # frozen: v1.29.0 + rev: fa412071e4f5d44d44f9e365f4676f9df92456a2 # frozen: v1.30.1 hooks: - id: zizmor args: [--no-progress, --fix] diff --git a/requirements-tests.txt b/requirements-tests.txt index 35432cd35afd..ac8436cbc457 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,26 +1,26 @@ # Type checkers that we test our stubs against. These should always # be pinned to a specific version to make failure reproducible. -mypy==2.3.0 -pyrefly==1.3.0.dev1 +mypy==2.3.1 +pyrefly==1.3.1 pyright==1.1.414 -ty==0.0.59 +ty==0.0.83 # Libraries used by our various scripts. aiohttp==3.14.3 grpcio-tools>=1.76.0; python_version < "3.15" # For grpc_tools.protoc mypy-protobuf==5.1.0; python_version < "3.15" -packaging==26.2 +packaging==26.3 pathspec>=1.1.1 pre-commit -ruff==0.15.20 +ruff==0.16.8 # Required by create_baseline_stubs.py. # stubdefaulter depends on libcst, which does not yet install cleanly on Python 3.15. stubdefaulter==0.1.0; python_version < "3.15" termcolor>=2.3 tomli==2.4.1; python_version < "3.11" -tomlkit==0.15.0 +tomlkit==0.15.1 typing_extensions>=4.16.0rc2 -uv==0.11.26 +uv==0.12.18 # Utilities for typeshed infrastructure scripts. ts_utils @ file:lib From b18003d24c007b29b2d36ec657bd5a4ad7796d16 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 1 Oct 2026 04:42:02 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/_interpreters.pyi | 2 +- stdlib/_ssl.pyi | 2 +- stdlib/ast.pyi | 54 +++++++++---------- stdlib/asyncio/subprocess.pyi | 24 ++++----- stdlib/cgi.pyi | 2 +- stdlib/doctest.pyi | 12 ++--- stdlib/imp.pyi | 2 +- stdlib/json/__init__.pyi | 4 +- stdlib/lib2to3/refactor.pyi | 2 +- stdlib/nntplib.pyi | 2 +- stdlib/pstats.pyi | 10 ++-- stdlib/shutil.pyi | 2 +- stdlib/typing_extensions.pyi | 2 +- stdlib/unittest/main.pyi | 2 +- stdlib/unittest/mock.pyi | 4 +- stdlib/urllib/parse.pyi | 18 +++---- stubs/WebOb/webob/acceptparse.pyi | 2 +- stubs/WebOb/webob/dec.pyi | 2 +- stubs/croniter/croniter/croniter.pyi | 2 +- stubs/docker/docker/utils/proxy.pyi | 2 +- stubs/geojson/geojson/base.pyi | 2 +- stubs/geojson/geojson/feature.pyi | 2 +- stubs/geojson/geojson/geometry.pyi | 4 +- stubs/geopandas/geopandas/geoseries.pyi | 2 +- stubs/gevent/gevent/_hub_primitives.pyi | 2 +- stubs/gevent/gevent/timeout.pyi | 2 +- .../networkx/networkx/classes/reportviews.pyi | 6 +-- stubs/networkx/networkx/utils/backends.pyi | 2 +- stubs/objgraph/objgraph.pyi | 4 +- stubs/paramiko/paramiko/ber.pyi | 4 +- stubs/paramiko/paramiko/file.pyi | 2 +- stubs/paramiko/paramiko/rsakey.pyi | 4 +- stubs/paramiko/paramiko/sftp_client.pyi | 2 +- stubs/passpy/passpy/store.pyi | 4 +- stubs/pywin32/win32/win32api.pyi | 2 +- stubs/pywin32/win32/win32crypt.pyi | 6 +-- stubs/pywin32/win32/win32pipe.pyi | 2 +- .../win32comext/axscript/client/error.pyi | 2 +- stubs/reportlab/reportlab/lib/rltempfile.pyi | 2 +- .../requests_oauthlib/oauth2_session.pyi | 2 +- stubs/requests/requests/adapters.pyi | 8 +-- stubs/requests/requests/sessions.pyi | 2 +- stubs/seaborn/seaborn/_core/plot.pyi | 2 +- stubs/seaborn/seaborn/_core/scales.pyi | 2 +- stubs/seaborn/seaborn/axisgrid.pyi | 8 +-- stubs/setuptools/setuptools/depends.pyi | 6 +-- stubs/tensorflow/tensorflow/__init__.pyi | 4 +- .../tensorflow/autograph/__init__.pyi | 4 +- .../tensorflow/tensorflow/config/__init__.pyi | 6 +-- .../tensorflow/keras/layers/__init__.pyi | 8 +-- stubs/tensorflow/tensorflow/keras/models.pyi | 8 +-- stubs/tensorflow/tensorflow/nn.pyi | 2 +- .../tensorflow/tensorflow/train/__init__.pyi | 8 +-- .../workalendar/europe/__init__.pyi | 1 - stubs/yt-dlp/yt_dlp/update.pyi | 2 +- 55 files changed, 140 insertions(+), 141 deletions(-) diff --git a/stdlib/_interpreters.pyi b/stdlib/_interpreters.pyi index a7ef6d1fcecf..d9a9a3a05227 100644 --- a/stdlib/_interpreters.pyi +++ b/stdlib/_interpreters.pyi @@ -33,7 +33,7 @@ def get_config(id: SupportsIndex, *, restrict: bool = False) -> types.SimpleName def whence(id: SupportsIndex) -> _Whence: ... def exec( id: SupportsIndex, code: str | types.CodeType | Callable[[], object], shared: _SharedDict = {}, *, restrict: bool = False -) -> None | types.SimpleNamespace: ... +) -> types.SimpleNamespace | None: ... def call( id: SupportsIndex, callable: Callable[..., _R], diff --git a/stdlib/_ssl.pyi b/stdlib/_ssl.pyi index 87023d90e13b..29e50111b8b2 100644 --- a/stdlib/_ssl.pyi +++ b/stdlib/_ssl.pyi @@ -79,7 +79,7 @@ class _SSLContext: post_handshake_auth: bool protocol: int security_level: int - sni_callback: Callable[[SSLObject, str, SSLContext], None | int] | None + sni_callback: Callable[[SSLObject, str, SSLContext], int | None] | None verify_flags: int verify_mode: int def __new__(cls, protocol: int, /) -> Self: ... diff --git a/stdlib/ast.pyi b/stdlib/ast.pyi index a1993773ee25..9f6b9f823620 100644 --- a/stdlib/ast.pyi +++ b/stdlib/ast.pyi @@ -1741,7 +1741,7 @@ if sys.version_info >= (3, 15): mode: Literal["exec", "eval", "func_type", "single"] = "exec", *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, module: str | None = None, ) -> _T: ... @@ -1752,7 +1752,7 @@ if sys.version_info >= (3, 15): mode: Literal["exec"] = "exec", *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, module: str | None = None, ) -> Module: ... @@ -1763,7 +1763,7 @@ if sys.version_info >= (3, 15): mode: Literal["eval"], *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, module: str | None = None, ) -> Expression: ... @@ -1774,7 +1774,7 @@ if sys.version_info >= (3, 15): mode: Literal["func_type"], *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, module: str | None = None, ) -> FunctionType: ... @@ -1785,7 +1785,7 @@ if sys.version_info >= (3, 15): mode: Literal["single"], *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, module: str | None = None, ) -> Interactive: ... @@ -1795,7 +1795,7 @@ if sys.version_info >= (3, 15): *, mode: Literal["eval"], type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, module: str | None = None, ) -> Expression: ... @@ -1805,7 +1805,7 @@ if sys.version_info >= (3, 15): *, mode: Literal["func_type"], type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, module: str | None = None, ) -> FunctionType: ... @@ -1815,7 +1815,7 @@ if sys.version_info >= (3, 15): *, mode: Literal["single"], type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, module: str | None = None, ) -> Interactive: ... @@ -1826,7 +1826,7 @@ if sys.version_info >= (3, 15): mode: str = "exec", *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, module: str | None = None, ) -> mod: ... @@ -1838,7 +1838,7 @@ elif sys.version_info >= (3, 13): mode: Literal["exec", "eval", "func_type", "single"] = "exec", *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, ) -> _T: ... @overload @@ -1848,7 +1848,7 @@ elif sys.version_info >= (3, 13): mode: Literal["exec"] = "exec", *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, ) -> Module: ... @overload @@ -1858,7 +1858,7 @@ elif sys.version_info >= (3, 13): mode: Literal["eval"], *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, ) -> Expression: ... @overload @@ -1868,7 +1868,7 @@ elif sys.version_info >= (3, 13): mode: Literal["func_type"], *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, ) -> FunctionType: ... @overload @@ -1878,7 +1878,7 @@ elif sys.version_info >= (3, 13): mode: Literal["single"], *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, ) -> Interactive: ... @overload @@ -1887,7 +1887,7 @@ elif sys.version_info >= (3, 13): *, mode: Literal["eval"], type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, ) -> Expression: ... @overload @@ -1896,7 +1896,7 @@ elif sys.version_info >= (3, 13): *, mode: Literal["func_type"], type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, ) -> FunctionType: ... @overload @@ -1905,7 +1905,7 @@ elif sys.version_info >= (3, 13): *, mode: Literal["single"], type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, ) -> Interactive: ... @overload @@ -1915,7 +1915,7 @@ elif sys.version_info >= (3, 13): mode: str = "exec", *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, optimize: Literal[-1, 0, 1, 2] = -1, ) -> mod: ... else: @@ -1926,7 +1926,7 @@ else: mode: Literal["exec", "eval", "func_type", "single"] = "exec", *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, ) -> _T: ... @overload def parse( @@ -1935,7 +1935,7 @@ else: mode: Literal["exec"] = "exec", *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, ) -> Module: ... @overload def parse( @@ -1944,7 +1944,7 @@ else: mode: Literal["eval"], *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, ) -> Expression: ... @overload def parse( @@ -1953,7 +1953,7 @@ else: mode: Literal["func_type"], *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, ) -> FunctionType: ... @overload def parse( @@ -1962,7 +1962,7 @@ else: mode: Literal["single"], *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, ) -> Interactive: ... @overload def parse( @@ -1970,7 +1970,7 @@ else: *, mode: Literal["eval"], type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, ) -> Expression: ... @overload def parse( @@ -1978,7 +1978,7 @@ else: *, mode: Literal["func_type"], type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, ) -> FunctionType: ... @overload def parse( @@ -1986,7 +1986,7 @@ else: *, mode: Literal["single"], type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, ) -> Interactive: ... @overload def parse( @@ -1995,7 +1995,7 @@ else: mode: str = "exec", *, type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, + feature_version: int | tuple[int, int] | None = None, ) -> mod: ... def literal_eval(node_or_string: str | AST) -> Any: ... diff --git a/stdlib/asyncio/subprocess.pyi b/stdlib/asyncio/subprocess.pyi index 6405e5ae1474..7f447cf1d82a 100644 --- a/stdlib/asyncio/subprocess.pyi +++ b/stdlib/asyncio/subprocess.pyi @@ -61,9 +61,9 @@ if sys.version_info >= (3, 11): restore_signals: bool = True, start_new_session: bool = False, pass_fds: Collection[int] = (), - group: None | str | int = None, - extra_groups: None | Collection[str | int] = None, - user: None | str | int = None, + group: str | int | None = None, + extra_groups: Collection[str | int] | None = None, + user: str | int | None = None, umask: int = -1, process_group: int | None = None, pipesize: int = -1, @@ -93,9 +93,9 @@ if sys.version_info >= (3, 11): restore_signals: bool = True, start_new_session: bool = False, pass_fds: Collection[int] = (), - group: None | str | int = None, - extra_groups: None | Collection[str | int] = None, - user: None | str | int = None, + group: str | int | None = None, + extra_groups: Collection[str | int] | None = None, + user: str | int | None = None, umask: int = -1, process_group: int | None = None, pipesize: int = -1, @@ -127,9 +127,9 @@ else: restore_signals: bool = True, start_new_session: bool = False, pass_fds: Collection[int] = (), - group: None | str | int = None, - extra_groups: None | Collection[str | int] = None, - user: None | str | int = None, + group: str | int | None = None, + extra_groups: Collection[str | int] | None = None, + user: str | int | None = None, umask: int = -1, pipesize: int = -1, ) -> Process: ... @@ -158,9 +158,9 @@ else: restore_signals: bool = True, start_new_session: bool = False, pass_fds: Collection[int] = (), - group: None | str | int = None, - extra_groups: None | Collection[str | int] = None, - user: None | str | int = None, + group: str | int | None = None, + extra_groups: Collection[str | int] | None = None, + user: str | int | None = None, umask: int = -1, pipesize: int = -1, ) -> Process: ... diff --git a/stdlib/cgi.pyi b/stdlib/cgi.pyi index b7f88ded315f..fd8752aa6532 100644 --- a/stdlib/cgi.pyi +++ b/stdlib/cgi.pyi @@ -81,7 +81,7 @@ class FieldStorage: length: int done: int list: _list[Any] | None - value: None | bytes | _list[Any] + value: bytes | _list[Any] | None def __init__( self, fp: IO[Any] | None = None, diff --git a/stdlib/doctest.pyi b/stdlib/doctest.pyi index 7d1dfe6d8a92..000278ae953e 100644 --- a/stdlib/doctest.pyi +++ b/stdlib/doctest.pyi @@ -133,7 +133,7 @@ class DocTestFinder: self, obj: object, name: str | None = None, - module: None | bool | types.ModuleType = None, + module: bool | types.ModuleType | None = None, globs: dict[str, Any] | None = None, extraglobs: dict[str, Any] | None = None, ) -> list[DocTest]: ... @@ -198,7 +198,7 @@ def testfile( filename: str, module_relative: bool = True, name: str | None = None, - package: None | str | types.ModuleType = None, + package: str | types.ModuleType | None = None, globs: dict[str, Any] | None = None, verbose: bool | None = None, report: bool = True, @@ -239,7 +239,7 @@ class SkipDocTestCase(DocTestCase): class _DocTestSuite(unittest.TestSuite): ... def DocTestSuite( - module: None | str | types.ModuleType = None, + module: str | types.ModuleType | None = None, globs: dict[str, Any] | None = None, extraglobs: dict[str, Any] | None = None, test_finder: DocTestFinder | None = None, @@ -251,7 +251,7 @@ class DocFileCase(DocTestCase): ... def DocFileTest( path: str, module_relative: bool = True, - package: None | str | types.ModuleType = None, + package: str | types.ModuleType | None = None, globs: dict[str, Any] | None = None, parser: DocTestParser = ..., encoding: str | None = None, @@ -259,7 +259,7 @@ def DocFileTest( ) -> DocFileCase: ... def DocFileSuite(*paths: str, **kw: Any) -> _DocTestSuite: ... def script_from_examples(s: str) -> str: ... -def testsource(module: None | str | types.ModuleType, name: str) -> str: ... +def testsource(module: str | types.ModuleType | None, name: str) -> str: ... def debug_src(src: str, pm: bool = False, globs: dict[str, Any] | None = None) -> None: ... def debug_script(src: str, pm: bool = False, globs: dict[str, Any] | None = None) -> None: ... -def debug(module: None | str | types.ModuleType, name: str, pm: bool = False) -> None: ... +def debug(module: str | types.ModuleType | None, name: str, pm: bool = False) -> None: ... diff --git a/stdlib/imp.pyi b/stdlib/imp.pyi index b5b4223aa58e..69351dede052 100644 --- a/stdlib/imp.pyi +++ b/stdlib/imp.pyi @@ -56,7 +56,7 @@ def load_module(name: str, file: _FileLike | None, filename: str, details: tuple # IO[Any] is a TextIOWrapper if name is a .py file, and a FileIO otherwise. def find_module( - name: str, path: None | list[str] | list[PathLike[str]] | list[StrPath] = None + name: str, path: list[str] | list[PathLike[str]] | list[StrPath] | None = None ) -> tuple[IO[Any], str, tuple[str, str, int]]: ... def reload(module: types.ModuleType) -> types.ModuleType: ... def init_builtin(name: str) -> types.ModuleType | None: ... diff --git a/stdlib/json/__init__.pyi b/stdlib/json/__init__.pyi index 2342b29cb0c8..d853722c0fc8 100644 --- a/stdlib/json/__init__.pyi +++ b/stdlib/json/__init__.pyi @@ -16,7 +16,7 @@ def dumps( check_circular: bool = True, allow_nan: bool = True, cls: type[JSONEncoder] | None = None, - indent: None | int | str = None, + indent: int | str | None = None, separators: tuple[str, str] | None = None, default: Callable[[Any], Any] | None = None, sort_keys: bool = False, @@ -31,7 +31,7 @@ def dump( check_circular: bool = True, allow_nan: bool = True, cls: type[JSONEncoder] | None = None, - indent: None | int | str = None, + indent: int | str | None = None, separators: tuple[str, str] | None = None, default: Callable[[Any], Any] | None = None, sort_keys: bool = False, diff --git a/stdlib/lib2to3/refactor.pyi b/stdlib/lib2to3/refactor.pyi index b365d64a1de1..9031b1009715 100644 --- a/stdlib/lib2to3/refactor.pyi +++ b/stdlib/lib2to3/refactor.pyi @@ -79,7 +79,7 @@ class RefactoringTool: class MultiprocessingUnsupported(Exception): ... class MultiprocessRefactoringTool(RefactoringTool): - queue: JoinableQueue[None | tuple[Iterable[str], bool | int]] | None + queue: JoinableQueue[tuple[Iterable[str], bool | int] | None] | None output_lock: Lock | None def refactor( self, items: Iterable[str], write: bool = False, doctests_only: bool = False, num_processes: int = 1 diff --git a/stdlib/nntplib.pyi b/stdlib/nntplib.pyi index 50b633ce1ad1..926b07be79e6 100644 --- a/stdlib/nntplib.pyi +++ b/stdlib/nntplib.pyi @@ -95,7 +95,7 @@ class NNTP: def xhdr(self, hdr: str, str: Any, *, file: _File = None) -> tuple[str, _list[str]]: ... def xover(self, start: int, end: int, *, file: _File = None) -> tuple[str, _list[tuple[int, dict[str, str]]]]: ... def over( - self, message_spec: None | str | _list[Any] | tuple[Any, ...], *, file: _File = None + self, message_spec: str | _list[Any] | tuple[Any, ...] | None, *, file: _File = None ) -> tuple[str, _list[tuple[int, dict[str, str]]]]: ... def date(self) -> tuple[str, datetime.datetime]: ... def post(self, data: bytes | Iterable[bytes]) -> str: ... diff --git a/stdlib/pstats.pyi b/stdlib/pstats.pyi index 19eb683df166..8f244fde02c3 100644 --- a/stdlib/pstats.pyi +++ b/stdlib/pstats.pyi @@ -61,15 +61,15 @@ class Stats: sort_arg_dict_default: _SortArgDict def __init__( self, - arg: None | str | Profile | _cProfile = None, + arg: str | Profile | _cProfile | None = None, /, - *args: None | str | Profile | _cProfile | Self, + *args: str | Profile | _cProfile | Self | None, stream: IO[Any] | None = None, ) -> None: ... - def init(self, arg: None | str | Profile | _cProfile) -> None: ... - def load_stats(self, arg: None | str | Profile | _cProfile) -> None: ... + def init(self, arg: str | Profile | _cProfile | None) -> None: ... + def load_stats(self, arg: str | Profile | _cProfile | None) -> None: ... def get_top_level_stats(self) -> None: ... - def add(self, *arg_list: None | str | Profile | _cProfile | Self) -> Self: ... + def add(self, *arg_list: str | Profile | _cProfile | Self | None) -> Self: ... def dump_stats(self, filename: StrOrBytesPath) -> None: ... def get_sort_arg_defs(self) -> _SortArgDict: ... diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index 5919106f3ed9..920157948ada 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -73,7 +73,7 @@ def copytree( src: StrPath, dst: _StrPathT, symlinks: bool = False, - ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = None, + ignore: Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] | None = None, copy_function: Callable[[str, str], object] = ..., ignore_dangling_symlinks: bool = False, dirs_exist_ok: bool = False, diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index 69dceba1476e..ab1a401748ed 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -541,7 +541,7 @@ else: self, name: str, *, - bound: None | AnnotationForm | str = None, + bound: AnnotationForm | str | None = None, contravariant: bool = False, covariant: bool = False, default: AnnotationForm = ..., diff --git a/stdlib/unittest/main.pyi b/stdlib/unittest/main.pyi index 09b547cd1cd6..87200bd02b05 100644 --- a/stdlib/unittest/main.pyi +++ b/stdlib/unittest/main.pyi @@ -48,7 +48,7 @@ class TestProgram: else: def __init__( self, - module: None | str | ModuleType = "__main__", + module: str | ModuleType | None = "__main__", defaultTest: str | Iterable[str] | None = None, argv: list[str] | None = None, testRunner: type[_TestRunner] | _TestRunner | None = None, diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index a7a0eec39136..de88e30f0fe3 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -544,10 +544,10 @@ if sys.version_info >= (3, 13): class ThreadingMixin(Base): DEFAULT_TIMEOUT: Final[float | None] = None - def __init__(self, /, *args: Any, timeout: float | None | _SentinelObject = ..., **kwargs: Any) -> None: ... + def __init__(self, /, *args: Any, timeout: float | _SentinelObject | None = ..., **kwargs: Any) -> None: ... # Same as `NonCallableMock.reset_mock.` def reset_mock(self, visited: Any = None, *, return_value: bool = False, side_effect: bool = False) -> None: ... - def wait_until_called(self, *, timeout: float | None | _SentinelObject = ...) -> None: ... + def wait_until_called(self, *, timeout: float | _SentinelObject | None = ...) -> None: ... def wait_until_any_call_with(self, *args: Any, **kwargs: Any) -> None: ... class ThreadingMock(ThreadingMixin, MagicMixin, Mock): ... diff --git a/stdlib/urllib/parse.pyi b/stdlib/urllib/parse.pyi index b83a0f4e8678..a3250b4092f0 100644 --- a/stdlib/urllib/parse.pyi +++ b/stdlib/urllib/parse.pyi @@ -238,7 +238,7 @@ def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = True) -> A def urlparse(url: str, scheme: str = "", allow_fragments: bool = True) -> ParseResult: ... @overload def urlparse( - url: bytes | bytearray | None, scheme: bytes | bytearray | None | Literal[""] = "", allow_fragments: bool = True + url: bytes | bytearray | None, scheme: bytes | bytearray | Literal[""] | None = "", allow_fragments: bool = True ) -> ParseResultBytes: ... if sys.version_info >= (3, 15): @overload @@ -252,7 +252,7 @@ if sys.version_info >= (3, 15): @overload def urlparse( url: bytes | bytearray | None, - scheme: bytes | bytearray | None | Literal[""] = "", + scheme: bytes | bytearray | Literal[""] | None = "", allow_fragments: bool = True, *, missing_as_none: Literal[True], @@ -260,7 +260,7 @@ if sys.version_info >= (3, 15): @overload def urlparse( url: bytes | bytearray | None, - scheme: bytes | bytearray | None | Literal[""] = "", + scheme: bytes | bytearray | Literal[""] | None = "", allow_fragments: bool = True, *, missing_as_none: Literal[False] = False, @@ -272,7 +272,7 @@ if sys.version_info >= (3, 15): @overload def urlparse( url: bytes | bytearray | None, - scheme: bytes | bytearray | None | Literal[""] = "", + scheme: bytes | bytearray | Literal[""] | None = "", allow_fragments: bool = True, *, missing_as_none: bool, @@ -284,12 +284,12 @@ def urlsplit(url: str, scheme: str = "", allow_fragments: bool = True) -> SplitR if sys.version_info >= (3, 11): @overload def urlsplit( - url: bytes | None, scheme: bytes | None | Literal[""] = "", allow_fragments: bool = True + url: bytes | None, scheme: bytes | Literal[""] | None = "", allow_fragments: bool = True ) -> SplitResultBytes: ... else: @overload def urlsplit( - url: bytes | bytearray | None, scheme: bytes | bytearray | None | Literal[""] = "", allow_fragments: bool = True + url: bytes | bytearray | None, scheme: bytes | bytearray | Literal[""] | None = "", allow_fragments: bool = True ) -> SplitResultBytes: ... if sys.version_info >= (3, 15): @overload @@ -303,7 +303,7 @@ if sys.version_info >= (3, 15): @overload def urlsplit( url: bytes | None, - scheme: bytes | None | Literal[""] = "", + scheme: bytes | Literal[""] | None = "", allow_fragments: bool = True, *, missing_as_none: Literal[True], @@ -311,7 +311,7 @@ if sys.version_info >= (3, 15): @overload def urlsplit( url: bytes | None, - scheme: bytes | None | Literal[""] = "", + scheme: bytes | Literal[""] | None = "", allow_fragments: bool = True, *, missing_as_none: Literal[False] = False, @@ -322,7 +322,7 @@ if sys.version_info >= (3, 15): ) -> SplitResult[str | None]: ... @overload def urlsplit( - url: bytes | None, scheme: bytes | None | Literal[""] = "", allow_fragments: bool = True, *, missing_as_none: bool + url: bytes | None, scheme: bytes | Literal[""] | None = "", allow_fragments: bool = True, *, missing_as_none: bool ) -> SplitResultBytes[bytes | None]: ... if sys.version_info >= (3, 15): diff --git a/stubs/WebOb/webob/acceptparse.pyi b/stubs/WebOb/webob/acceptparse.pyi index 6ccc4c804f26..77917501bc6d 100644 --- a/stubs/WebOb/webob/acceptparse.pyi +++ b/stubs/WebOb/webob/acceptparse.pyi @@ -227,7 +227,7 @@ def create_accept_header(header_value: AcceptValidHeader | Literal[""]) -> Accep @overload def create_accept_header(header_value: AcceptInvalidHeader) -> AcceptInvalidHeader: ... @overload -def create_accept_header(header_value: None | AcceptNoHeader) -> AcceptNoHeader: ... +def create_accept_header(header_value: AcceptNoHeader | None) -> AcceptNoHeader: ... @overload def create_accept_header(header_value: str) -> AcceptValidHeader | AcceptInvalidHeader: ... @overload diff --git a/stubs/WebOb/webob/dec.pyi b/stubs/WebOb/webob/dec.pyi index b8f58a6906e7..bfb8040ecf45 100644 --- a/stubs/WebOb/webob/dec.pyi +++ b/stubs/WebOb/webob/dec.pyi @@ -122,7 +122,7 @@ class wsgify(Generic[_P, _RequestT_contra]): @overload @classmethod def middleware( - cls, middle_func: None = None, app: None | _AppT = None, *_: _P.args, **kw: _P.kwargs + cls, middle_func: None = None, app: _AppT | None = None, *_: _P.args, **kw: _P.kwargs ) -> _UnboundMiddleware[_P, _AppT, Any]: ... @overload @classmethod diff --git a/stubs/croniter/croniter/croniter.pyi b/stubs/croniter/croniter/croniter.pyi index b9ba661e3ca9..ce5ecf5a59cf 100644 --- a/stubs/croniter/croniter/croniter.pyi +++ b/stubs/croniter/croniter/croniter.pyi @@ -352,7 +352,7 @@ class HashExpander: idx: int, expr: str, hash_id: bytes | None = None, - match: Match[str] | None | Literal[""] = "", + match: Match[str] | Literal[""] | None = "", **kw: object, ) -> str: ... diff --git a/stubs/docker/docker/utils/proxy.pyi b/stubs/docker/docker/utils/proxy.pyi index a8e84d1a6ba1..c0c5a038e45b 100644 --- a/stubs/docker/docker/utils/proxy.pyi +++ b/stubs/docker/docker/utils/proxy.pyi @@ -32,4 +32,4 @@ class ProxyConfig(dict[str, str]): @staticmethod def from_dict(config: _ProxyConfigDict) -> ProxyConfig: ... def get_environment(self) -> _Environment: ... - def inject_proxy_environment(self, environment: None | Sequence[str]) -> None | Sequence[str]: ... + def inject_proxy_environment(self, environment: Sequence[str] | None) -> Sequence[str] | None: ... diff --git a/stubs/geojson/geojson/base.pyi b/stubs/geojson/geojson/base.pyi index 7472837e0814..c75f2d4c7989 100644 --- a/stubs/geojson/geojson/base.pyi +++ b/stubs/geojson/geojson/base.pyi @@ -8,7 +8,7 @@ class GeoJSON(dict[str, Any]): def __setattr__(self, name: str, value) -> None: ... def __delattr__(self, name: str) -> None: ... @property - def __geo_interface__(self) -> None | GeoJSON: ... + def __geo_interface__(self) -> GeoJSON | None: ... @classmethod def to_instance(cls, ob, default=None, strict: bool = False) -> GeoJSON: ... @property diff --git a/stubs/geojson/geojson/feature.pyi b/stubs/geojson/geojson/feature.pyi index 41aff456863e..e2834fa45dd0 100644 --- a/stubs/geojson/geojson/feature.pyi +++ b/stubs/geojson/geojson/feature.pyi @@ -5,7 +5,7 @@ from geojson.geometry import Geometry class Feature(GeoJSON): def __init__( - self, id: None | str | int = None, geometry: None | Geometry = None, properties: None | dict[str, Any] = None, **extra + self, id: str | int | None = None, geometry: Geometry | None = None, properties: dict[str, Any] | None = None, **extra ) -> None: ... def errors(self) -> list[str] | None: ... diff --git a/stubs/geojson/geojson/geometry.pyi b/stubs/geojson/geojson/geometry.pyi index 290feaf7f6a0..57e2f1918e5c 100644 --- a/stubs/geojson/geojson/geometry.pyi +++ b/stubs/geojson/geojson/geometry.pyi @@ -12,9 +12,9 @@ DEFAULT_PRECISION: int class Geometry(GeoJSON): def __init__( self, - coordinates: None | Sequence[_InputCoord] | Geometry = None, + coordinates: Sequence[_InputCoord] | Geometry | None = None, validate: bool = False, - precision: None | int = None, + precision: int | None = None, **extra, ) -> None: ... @classmethod diff --git a/stubs/geopandas/geopandas/geoseries.pyi b/stubs/geopandas/geopandas/geoseries.pyi index 764fdb0a79a6..cf5c5ca81337 100644 --- a/stubs/geopandas/geopandas/geoseries.pyi +++ b/stubs/geopandas/geopandas/geoseries.pyi @@ -194,7 +194,7 @@ class GeoSeries(GeoPandasBase, pd.Series[BaseGeometry]): # type: ignore[type-va check_circular: bool = True, allow_nan: bool = True, cls: type[json.JSONEncoder] | None = None, - indent: None | int | str = None, + indent: int | str | None = None, separators: tuple[str, str] | None = None, default: Callable[..., Any] | None = None, # as typed in the json stdlib module sort_keys: bool = False, diff --git a/stubs/gevent/gevent/_hub_primitives.pyi b/stubs/gevent/gevent/_hub_primitives.pyi index 9771e2adf81d..8be21a4d546b 100644 --- a/stubs/gevent/gevent/_hub_primitives.pyi +++ b/stubs/gevent/gevent/_hub_primitives.pyi @@ -34,7 +34,7 @@ class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): @disjoint_base class _WaitIterator(Generic[_T]): - def __init__(self, objects: Collection[_T], hub: Hub, timeout: float, count: None | int) -> None: ... + def __init__(self, objects: Collection[_T], hub: Hub, timeout: float, count: int | None) -> None: ... def __enter__(self) -> Self: ... def __exit__(self, typ: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None) -> None: ... def __iter__(self) -> Self: ... diff --git a/stubs/gevent/gevent/timeout.pyi b/stubs/gevent/gevent/timeout.pyi index 0278eb2b51dd..413d605350ce 100644 --- a/stubs/gevent/gevent/timeout.pyi +++ b/stubs/gevent/gevent/timeout.pyi @@ -32,7 +32,7 @@ class Timeout(BaseException): @overload @classmethod def start_new( - cls, timeout: None | float = None, exception: type[BaseException] | BaseException | None = None, ref: bool = True + cls, timeout: float | None = None, exception: type[BaseException] | BaseException | None = None, ref: bool = True ) -> Self: ... @overload @classmethod diff --git a/stubs/networkx/networkx/classes/reportviews.pyi b/stubs/networkx/networkx/classes/reportviews.pyi index a133389f2420..5bf0396d6108 100644 --- a/stubs/networkx/networkx/classes/reportviews.pyi +++ b/stubs/networkx/networkx/classes/reportviews.pyi @@ -62,13 +62,13 @@ class NodeDataView(AbstractSet[_Node], Generic[_Node, _NodeData, _EdgeData]): class DiDegreeView(Generic[_Node, _NodeData, _EdgeData]): def __init__( - self, G: Graph[_Node, _NodeData, _EdgeData], nbunch: _NBunch[_Node] = None, weight: None | bool | str = None + self, G: Graph[_Node, _NodeData, _EdgeData], nbunch: _NBunch[_Node] = None, weight: bool | str | None = None ) -> None: ... @overload # Use this overload first in case _Node=str, since `str` matches `Iterable[str]` - def __call__(self, nbunch: _Node, weight: None | bool | str = None) -> int: ... # type: ignore[overload-overlap] + def __call__(self, nbunch: _Node, weight: bool | str | None = None) -> int: ... # type: ignore[overload-overlap] @overload - def __call__(self, nbunch: Iterable[_Node] | None = None, weight: None | bool | str = None) -> Self: ... + def __call__(self, nbunch: Iterable[_Node] | None = None, weight: bool | str | None = None) -> Self: ... def __getitem__(self, n: _Node) -> int: ... def __iter__(self) -> Iterator[tuple[_Node, int]]: ... diff --git a/stubs/networkx/networkx/utils/backends.pyi b/stubs/networkx/networkx/utils/backends.pyi index 0935d701d8e3..18bc3359e827 100644 --- a/stubs/networkx/networkx/utils/backends.pyi +++ b/stubs/networkx/networkx/utils/backends.pyi @@ -33,7 +33,7 @@ class _dispatchable(Generic[_P, _R]): func: Callable[_P, _R] | None = None, *, name: str | None = None, - graphs: str | None | Mapping[str, int] = "G", + graphs: str | Mapping[str, int] | None = "G", edge_attrs: str | dict[str, Any] | None = None, node_attrs: str | dict[str, Any] | None = None, preserve_edge_attrs: bool = False, diff --git a/stubs/objgraph/objgraph.pyi b/stubs/objgraph/objgraph.pyi index 8278461c3fde..02a4946387ea 100644 --- a/stubs/objgraph/objgraph.pyi +++ b/stubs/objgraph/objgraph.pyi @@ -69,7 +69,7 @@ def show_backrefs( shortnames: bool = True, output: SupportsWrite[str] | None = None, extra_node_attrs: Callable[[object], dict[str, str]] | None = None, -) -> None | _GraphvizSource: ... +) -> _GraphvizSource | None: ... def show_refs( objs: object, max_depth: int = 3, @@ -83,7 +83,7 @@ def show_refs( shortnames: bool = True, output: SupportsWrite[str] | None = None, extra_node_attrs: Callable[[object], dict[str, str]] | None = None, -) -> None | _GraphvizSource: ... +) -> _GraphvizSource | None: ... def show_chain( *chains: list[object], obj: object, predicate: _Filter, max_depth: int = 20, extra_ignore: Iterable[int] = () ) -> None: ... diff --git a/stubs/paramiko/paramiko/ber.pyi b/stubs/paramiko/paramiko/ber.pyi index d847e528a11a..f0a032a0d1bc 100644 --- a/stubs/paramiko/paramiko/ber.pyi +++ b/stubs/paramiko/paramiko/ber.pyi @@ -8,8 +8,8 @@ class BER: idx: int def __init__(self, content: bytes = b"") -> None: ... def asbytes(self) -> bytes: ... - def decode(self) -> None | int | list[int]: ... - def decode_next(self) -> None | int | list[int]: ... + def decode(self) -> int | list[int] | None: ... + def decode_next(self) -> int | list[int] | None: ... @staticmethod def decode_sequence(data: bytes) -> list[int | list[int]]: ... def encode_tlv(self, ident: int, val: bytes) -> None: ... diff --git a/stubs/paramiko/paramiko/file.pyi b/stubs/paramiko/paramiko/file.pyi index f18d2a8566f5..c9216f24036f 100644 --- a/stubs/paramiko/paramiko/file.pyi +++ b/stubs/paramiko/paramiko/file.pyi @@ -16,7 +16,7 @@ class BufferedFile(ClosingContextManager, Generic[AnyStr]): FLAG_LINE_BUFFERED: int FLAG_UNIVERSAL_NEWLINE: int - newlines: None | AnyStr | tuple[AnyStr, ...] + newlines: AnyStr | tuple[AnyStr, ...] | None def __init__(self) -> None: ... def __del__(self) -> None: ... def __iter__(self) -> BufferedFile[Any]: ... diff --git a/stubs/paramiko/paramiko/rsakey.pyi b/stubs/paramiko/paramiko/rsakey.pyi index 8c071bb19c17..d5e099a3e442 100644 --- a/stubs/paramiko/paramiko/rsakey.pyi +++ b/stubs/paramiko/paramiko/rsakey.pyi @@ -11,7 +11,7 @@ class RSAKey(PKey): name: Final = "ssh-rsa" HASHES: Final[dict[str, type[HashAlgorithm]]] - key: None | RSAPublicKey | RSAPrivateKey + key: RSAPublicKey | RSAPrivateKey | None public_blob: None def __init__( self, @@ -19,7 +19,7 @@ class RSAKey(PKey): data: ReadableBuffer | None = None, filename: FileDescriptorOrPath | None = None, password: str | None = None, - key: None | RSAPublicKey | RSAPrivateKey = None, + key: RSAPublicKey | RSAPrivateKey | None = None, file_obj: _HasReadlines | None = None, ) -> None: ... @classmethod diff --git a/stubs/paramiko/paramiko/sftp_client.pyi b/stubs/paramiko/paramiko/sftp_client.pyi index f0bc69af6290..f7876c243b9a 100644 --- a/stubs/paramiko/paramiko/sftp_client.pyi +++ b/stubs/paramiko/paramiko/sftp_client.pyi @@ -45,7 +45,7 @@ class SFTPClient(BaseSFTP, ClosingContextManager): def truncate(self, path: bytes | str, size: int) -> None: ... def readlink(self, path: bytes | str) -> str | None: ... def normalize(self, path: bytes | str) -> str: ... - def chdir(self, path: None | bytes | str = None) -> None: ... + def chdir(self, path: bytes | str | None = None) -> None: ... def getcwd(self) -> str | None: ... def putfo( self, fl: IO[bytes], remotepath: bytes | str, file_size: int = 0, callback: _Callback | None = None, confirm: bool = True diff --git a/stubs/passpy/passpy/store.pyi b/stubs/passpy/passpy/store.pyi index e906bbe38280..d69360f2b2c0 100644 --- a/stubs/passpy/passpy/store.pyi +++ b/stubs/passpy/passpy/store.pyi @@ -14,7 +14,7 @@ class Store: ) -> None: ... def __iter__(self) -> Iterator[str]: ... def is_init(self) -> bool: ... - def init_store(self, gpg_ids: None | str | list[str], path: StrPath | None = None) -> None: ... + def init_store(self, gpg_ids: str | list[str] | None, path: StrPath | None = None) -> None: ... def init_git(self) -> None: ... def git(self, method: str, *args: object, **kwargs: object) -> None: ... def get_key(self, path: StrPath | None) -> str | None: ... @@ -27,5 +27,5 @@ class Store: def move_path(self, old_path: StrPath, new_path: StrPath, force: bool = False) -> None: ... def list_dir(self, path: StrPath) -> tuple[list[str], list[str]]: ... def iter_dir(self, path: StrPath) -> Iterator[str]: ... - def find(self, names: None | str | list[str]) -> list[str]: ... + def find(self, names: str | list[str] | None) -> list[str]: ... def search(self, term: str) -> dict[str, list[tuple[str, Match[str]]]]: ... diff --git a/stubs/pywin32/win32/win32api.pyi b/stubs/pywin32/win32/win32api.pyi index 9f6d9bee2e52..493dcce90c87 100644 --- a/stubs/pywin32/win32/win32api.pyi +++ b/stubs/pywin32/win32/win32api.pyi @@ -26,7 +26,7 @@ class _FileVersionInfo(TypedDict): FileOS: int FileType: int FileSubtype: int - FileDate: None | Incomplete + FileDate: Incomplete | None @type_check_only class _PwrCapabilitiesBatteryScale(TypedDict): diff --git a/stubs/pywin32/win32/win32crypt.pyi b/stubs/pywin32/win32/win32crypt.pyi index b4fbf288f672..cf4056aaee0b 100644 --- a/stubs/pywin32/win32/win32crypt.pyi +++ b/stubs/pywin32/win32/win32crypt.pyi @@ -38,18 +38,18 @@ def CryptAcquireContext( ) -> _win32typing.PyCRYPTPROV | None: ... def CryptFindLocalizedName(CryptName: str) -> str | None: ... def CertEnumSystemStore( - Flags: int, SystemStoreLocationPara: str | Sequence[int | _win32typing.PyHANDLE | None | str] | None = None + Flags: int, SystemStoreLocationPara: str | Sequence[int | _win32typing.PyHANDLE | str | None] | None = None ) -> list[str]: ... def CertEnumSystemStoreLocation(Flags: int = 0) -> list[str]: ... def CertEnumPhysicalStore(SystemStore: str, Flags: int) -> list[str]: ... -def CertRegisterSystemStore(SystemStore: str | Sequence[int | _win32typing.PyHANDLE | None | str], Flags: int) -> None: ... +def CertRegisterSystemStore(SystemStore: str | Sequence[int | _win32typing.PyHANDLE | str | None], Flags: int) -> None: ... def CertUnregisterSystemStore(SystemStore: str, Flags: int) -> None: ... def CertOpenStore( StoreProvider: int, MsgAndCertEncodingType: int, CryptProv: _win32typing.PyCRYPTPROV | None, Flags: int, - Para: str | Sequence[int | _win32typing.PyHANDLE | None | str] | None, + Para: str | Sequence[int | _win32typing.PyHANDLE | str | None] | None, ) -> _win32typing.PyCERTSTORE | None: ... def CertOpenSystemStore(SubsystemProtocol: str, Prov: _win32typing.PyCRYPTPROV | None = None) -> _win32typing.PyCERTSTORE: ... diff --git a/stubs/pywin32/win32/win32pipe.pyi b/stubs/pywin32/win32/win32pipe.pyi index 14779bdc04ff..287f8aaeea85 100644 --- a/stubs/pywin32/win32/win32pipe.pyi +++ b/stubs/pywin32/win32/win32pipe.pyi @@ -7,7 +7,7 @@ def GetNamedPipeHandleState( hPipe: int, bGetCollectionData=..., / ) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete, str]: ... def SetNamedPipeHandleState( - hPipe: int, Mode: int, MaxCollectionCount: None | Incomplete, CollectDataTimeout: None | Incomplete, / + hPipe: int, Mode: int, MaxCollectionCount: Incomplete | None, CollectDataTimeout: Incomplete | None, / ) -> None: ... def ConnectNamedPipe(hPipe: int, overlapped: _win32typing.PyOVERLAPPED | None = ..., /): ... def TransactNamedPipe( diff --git a/stubs/pywin32/win32comext/axscript/client/error.pyi b/stubs/pywin32/win32comext/axscript/client/error.pyi index 40d95a89c137..b35b7599cf31 100644 --- a/stubs/pywin32/win32comext/axscript/client/error.pyi +++ b/stubs/pywin32/win32comext/axscript/client/error.pyi @@ -32,4 +32,4 @@ class AXScriptException(COMException): def ProcessAXScriptException( scriptingSite: AXSite, debugManager: DebugManager, exceptionInstance: AXScriptException -) -> None | COMException | AXScriptException: ... +) -> COMException | AXScriptException | None: ... diff --git a/stubs/reportlab/reportlab/lib/rltempfile.pyi b/stubs/reportlab/reportlab/lib/rltempfile.pyi index 24b270ff237c..b931ac51b75b 100644 --- a/stubs/reportlab/reportlab/lib/rltempfile.pyi +++ b/stubs/reportlab/reportlab/lib/rltempfile.pyi @@ -1,4 +1,4 @@ def get_rl_tempdir(*subdirs: str) -> str: ... def get_rl_tempfile(fn: str | None = None) -> str: ... -__all__ = ("get_rl_tempdir", "get_rl_tempdir") +__all__ = "get_rl_tempdir" diff --git a/stubs/requests-oauthlib/requests_oauthlib/oauth2_session.pyi b/stubs/requests-oauthlib/requests_oauthlib/oauth2_session.pyi index 001b57f52b77..911045dcdf8d 100644 --- a/stubs/requests-oauthlib/requests_oauthlib/oauth2_session.pyi +++ b/stubs/requests-oauthlib/requests_oauthlib/oauth2_session.pyi @@ -129,7 +129,7 @@ class OAuth2Session(requests.Session): files: _types.FilesType = None, *, params: _types.ParamsType = None, - cookies: None | RequestsCookieJar | dict[str, str] = None, + cookies: RequestsCookieJar | dict[str, str] | None = None, auth: _types.AuthType = None, timeout: _types.TimeoutType = None, allow_redirects: bool = True, diff --git a/stubs/requests/requests/adapters.pyi b/stubs/requests/requests/adapters.pyi index d34484da6107..df4f1d401412 100644 --- a/stubs/requests/requests/adapters.pyi +++ b/stubs/requests/requests/adapters.pyi @@ -64,9 +64,9 @@ class BaseAdapter: self, request: PreparedRequest, stream: bool = False, - timeout: None | float | tuple[float, float] | tuple[float, None] = None, + timeout: float | tuple[float, float] | tuple[float, None] | None = None, verify: bool | str = True, - cert: None | bytes | str | tuple[bytes | str, bytes | str] = None, + cert: bytes | str | tuple[bytes | str, bytes | str] | None = None, proxies: Mapping[str, str] | None = None, ) -> Response: ... def close(self) -> None: ... @@ -130,8 +130,8 @@ class HTTPAdapter(BaseAdapter): self, request: PreparedRequest, stream: bool = False, - timeout: None | float | tuple[float, float] | tuple[float, None] = None, + timeout: float | tuple[float, float] | tuple[float, None] | None = None, verify: bool | str = True, - cert: None | bytes | str | tuple[bytes | str, bytes | str] = None, + cert: bytes | str | tuple[bytes | str, bytes | str] | None = None, proxies: Mapping[str, str] | None = None, ) -> Response: ... diff --git a/stubs/requests/requests/sessions.pyi b/stubs/requests/requests/sessions.pyi index fc21257ed706..ee89384d9522 100644 --- a/stubs/requests/requests/sessions.pyi +++ b/stubs/requests/requests/sessions.pyi @@ -142,7 +142,7 @@ class Session(SessionRedirectMixin): params: _Params | None = None, data: _Data | None = None, headers: _HeadersUpdateMapping | None = None, - cookies: None | RequestsCookieJar | _TextMapping = None, + cookies: RequestsCookieJar | _TextMapping | None = None, files: _Files | None = None, auth: _Auth | None = None, timeout: _Timeout | None = None, diff --git a/stubs/seaborn/seaborn/_core/plot.pyi b/stubs/seaborn/seaborn/_core/plot.pyi index 7f8bf81069c6..8b8a5633dd44 100644 --- a/stubs/seaborn/seaborn/_core/plot.pyi +++ b/stubs/seaborn/seaborn/_core/plot.pyi @@ -102,7 +102,7 @@ class Plot: self, *, size: tuple[float, float] | Default = ..., - engine: str | None | Default = ..., + engine: str | Default | None = ..., extent: tuple[float, float, float, float] | Default = ..., ) -> Plot: ... def theme(self, config: dict[str, Any], /) -> Plot: ... diff --git a/stubs/seaborn/seaborn/_core/scales.pyi b/stubs/seaborn/seaborn/_core/scales.pyi index 8e164e265ef0..d9783cae9cc5 100644 --- a/stubs/seaborn/seaborn/_core/scales.pyi +++ b/stubs/seaborn/seaborn/_core/scales.pyi @@ -66,7 +66,7 @@ class Continuous(ContinuousBase): formatter: Formatter | None = None, *, like: str | Callable[[float], str] | None = None, - base: int | None | Default = ..., + base: int | Default | None = ..., unit: str | None = None, ) -> Self: ... diff --git a/stubs/seaborn/seaborn/axisgrid.pyi b/stubs/seaborn/seaborn/axisgrid.pyi index 3cc0dd8dabdc..80014f241ea7 100644 --- a/stubs/seaborn/seaborn/axisgrid.pyi +++ b/stubs/seaborn/seaborn/axisgrid.pyi @@ -74,16 +74,16 @@ class _BaseGrid: transform: Transform | None = ..., url: str | None = ..., visible: bool = ..., - xbound: float | None | tuple[float | None, float | None] = ..., + xbound: float | tuple[float | None, float | None] | None = ..., xlabel: str = ..., - xlim: float | None | tuple[float | None, float | None] = ..., + xlim: float | tuple[float | None, float | None] | None = ..., xmargin: float = ..., xscale: str | ScaleBase = ..., xticklabels: Iterable[str | Text] = ..., xticks: ArrayLike = ..., - ybound: float | None | tuple[float | None, float | None] = ..., + ybound: float | tuple[float | None, float | None] | None = ..., ylabel: str = ..., - ylim: float | None | tuple[float | None, float | None] = ..., + ylim: float | tuple[float | None, float | None] | None = ..., ymargin: float = ..., yscale: str | ScaleBase = ..., yticklabels: Iterable[str | Text] = ..., diff --git a/stubs/setuptools/setuptools/depends.pyi b/stubs/setuptools/setuptools/depends.pyi index 54ddd352768c..64c5cb9afa89 100644 --- a/stubs/setuptools/setuptools/depends.pyi +++ b/stubs/setuptools/setuptools/depends.pyi @@ -12,9 +12,9 @@ class Require: def __init__(self, name, requested_version, module, homepage: str = "", attribute=None, format=None) -> None: ... def full_name(self): ... def version_ok(self, version): ... - def get_version(self, paths=None, default: _T | Literal["unknown"] = "unknown") -> _T | Literal["unknown"] | None | Any: ... + def get_version(self, paths=None, default: _T | Literal["unknown"] = "unknown") -> _T | Literal["unknown"] | Any | None: ... def is_present(self, paths=None): ... def is_current(self, paths=None): ... -def get_module_constant(module, symbol, default: _T | int = -1, paths=None) -> _T | int | None | Any: ... -def extract_constant(code, symbol, default: _T | int = -1) -> _T | int | None | Any: ... +def get_module_constant(module, symbol, default: _T | int = -1, paths=None) -> _T | int | Any | None: ... +def extract_constant(code, symbol, default: _T | int = -1) -> _T | int | Any | None: ... diff --git a/stubs/tensorflow/tensorflow/__init__.pyi b/stubs/tensorflow/tensorflow/__init__.pyi index a8961b022b87..2580dec2f797 100644 --- a/stubs/tensorflow/tensorflow/__init__.pyi +++ b/stubs/tensorflow/tensorflow/__init__.pyi @@ -260,13 +260,13 @@ class Graph: def __getattr__(self, name: str) -> Incomplete: ... class IndexedSlices(metaclass=ABCMeta): - def __init__(self, values: Tensor, indices: Tensor, dense_shape: None | Tensor = None) -> None: ... + def __init__(self, values: Tensor, indices: Tensor, dense_shape: Tensor | None = None) -> None: ... @property def values(self) -> Tensor: ... @property def indices(self) -> Tensor: ... @property - def dense_shape(self) -> None | Tensor: ... + def dense_shape(self) -> Tensor | None: ... @property def shape(self) -> TensorShape: ... @property diff --git a/stubs/tensorflow/tensorflow/autograph/__init__.pyi b/stubs/tensorflow/tensorflow/autograph/__init__.pyi index 4058de0c3ec3..32246d94b8aa 100644 --- a/stubs/tensorflow/tensorflow/autograph/__init__.pyi +++ b/stubs/tensorflow/tensorflow/autograph/__init__.pyi @@ -9,9 +9,9 @@ def set_verbosity(level: int, alsologtostdout: bool = False) -> None: ... def to_code( entity: Callable[..., Any], recursive: bool = True, - experimental_optional_features: None | Feature | tuple[Feature, ...] = None, + experimental_optional_features: Feature | tuple[Feature, ...] | None = None, ) -> str: ... def to_graph( - entity: _Type, recursive: bool = True, experimental_optional_features: None | Feature | tuple[Feature, ...] = None + entity: _Type, recursive: bool = True, experimental_optional_features: Feature | tuple[Feature, ...] | None = None ) -> _Type: ... def trace(*args: Any) -> None: ... diff --git a/stubs/tensorflow/tensorflow/config/__init__.pyi b/stubs/tensorflow/tensorflow/config/__init__.pyi index 1eb72d000ff9..c68b78bd6181 100644 --- a/stubs/tensorflow/tensorflow/config/__init__.pyi +++ b/stubs/tensorflow/tensorflow/config/__init__.pyi @@ -6,7 +6,7 @@ class PhysicalDevice(NamedTuple): name: str device_type: str -def list_physical_devices(device_type: None | str = None) -> list[PhysicalDevice]: ... -def get_visible_devices(device_type: None | str = None) -> list[PhysicalDevice]: ... -def set_visible_devices(devices: list[PhysicalDevice] | PhysicalDevice, device_type: None | str = None) -> None: ... +def list_physical_devices(device_type: str | None = None) -> list[PhysicalDevice]: ... +def get_visible_devices(device_type: str | None = None) -> list[PhysicalDevice]: ... +def set_visible_devices(devices: list[PhysicalDevice] | PhysicalDevice, device_type: str | None = None) -> None: ... def __getattr__(name: str): ... # incomplete module diff --git a/stubs/tensorflow/tensorflow/keras/layers/__init__.pyi b/stubs/tensorflow/tensorflow/keras/layers/__init__.pyi index 19f93c023109..cba15d1a8a10 100644 --- a/stubs/tensorflow/tensorflow/keras/layers/__init__.pyi +++ b/stubs/tensorflow/tensorflow/keras/layers/__init__.pyi @@ -134,7 +134,7 @@ class _IndexLookup(Layer[tf.Tensor, tf.Tensor]): mask_token: str | None, oov_token: str, vocabulary_dtype: Literal["int64", "string"], - vocabulary: str | None | TensorCompatible = None, + vocabulary: str | TensorCompatible | None = None, idf_weights: TensorCompatible | None = None, invert: bool = False, output_mode: Literal["int", "count", "multi_hot", "one_hot", "tf_idf"] = "int", @@ -162,7 +162,7 @@ class StringLookup(_IndexLookup): num_oov_indices: int = 1, mask_token: str | None = None, oov_token: str = "[UNK]", - vocabulary: str | None | TensorCompatible = None, + vocabulary: str | TensorCompatible | None = None, idf_weights: TensorCompatible | None = None, invert: bool = False, output_mode: Literal["int", "count", "multi_hot", "one_hot", "tf_idf"] = "int", @@ -188,7 +188,7 @@ class IntegerLookup(_IndexLookup): num_oov_indices: int = 1, mask_token: int | None = None, oov_token: int = -1, - vocabulary: str | None | TensorCompatible = None, + vocabulary: str | TensorCompatible | None = None, vocabulary_dtype: Literal["int64"] = "int64", idf_weights: TensorCompatible | None = None, invert: bool = False, @@ -316,7 +316,7 @@ class Conv2D(Layer[tf.Tensor, tf.Tensor]): kernel_size: int | Iterable[int], strides: int | Iterable[int] = (1, 1), padding: Literal["valid", "same"] = "valid", - data_format: None | Literal["channels_last", "channels_first"] = None, + data_format: Literal["channels_last", "channels_first"] | None = None, dilation_rate: int | Iterable[int] = (1, 1), groups: int = 1, activation: _Activation = None, diff --git a/stubs/tensorflow/tensorflow/keras/models.pyi b/stubs/tensorflow/tensorflow/keras/models.pyi index aaf919a3573d..0e9a62ff4c87 100644 --- a/stubs/tensorflow/tensorflow/keras/models.pyi +++ b/stubs/tensorflow/tensorflow/keras/models.pyi @@ -150,12 +150,12 @@ class Model(Layer[_InputT_contra, _OutputT_co]): def weights(self) -> list[Variable]: ... def summary( self, - line_length: None | int = None, - positions: None | list[float] = None, - print_fn: None | Callable[[str], None] = None, + line_length: int | None = None, + positions: list[float] | None = None, + print_fn: Callable[[str], None] | None = None, expand_nested: bool = False, show_trainable: bool = False, - layer_range: None | list[str] | tuple[str, str] = None, + layer_range: list[str] | tuple[str, str] | None = None, ) -> None: ... @property def layers(self) -> list[Layer[Incomplete, Incomplete]]: ... diff --git a/stubs/tensorflow/tensorflow/nn.pyi b/stubs/tensorflow/tensorflow/nn.pyi index 014daddd9bba..4b926e8b0943 100644 --- a/stubs/tensorflow/tensorflow/nn.pyi +++ b/stubs/tensorflow/tensorflow/nn.pyi @@ -175,7 +175,7 @@ def log_poisson_loss( def moments( x: TensorCompatible | RaggedTensor, axes: TensorCompatible, - shift: None | Any = None, + shift: Any | None = None, keepdims: bool = False, name: str | None = None, ) -> tuple[Tensor, Tensor]: ... diff --git a/stubs/tensorflow/tensorflow/train/__init__.pyi b/stubs/tensorflow/tensorflow/train/__init__.pyi index 5735d1df673c..9dfede606317 100644 --- a/stubs/tensorflow/tensorflow/train/__init__.pyi +++ b/stubs/tensorflow/tensorflow/train/__init__.pyi @@ -27,18 +27,18 @@ class CheckpointOptions: "experimental_sharding_callback", "experimental_skip_slot_variables", ) - experimental_io_device: None | str + experimental_io_device: str | None experimental_enable_async_checkpoint: bool - experimental_write_callbacks: None | list[Callable[[str], object] | Callable[[], object]] + experimental_write_callbacks: list[Callable[[str], object] | Callable[[], object]] | None enable_async: bool experimental_sharding_callback: Incomplete # should be ShardingCallback experimental_skip_slot_variables: bool def __init__( self, - experimental_io_device: None | str = None, + experimental_io_device: str | None = None, experimental_enable_async_checkpoint: bool = False, - experimental_write_callbacks: None | list[Callable[[str], object] | Callable[[], object]] = None, + experimental_write_callbacks: list[Callable[[str], object] | Callable[[], object]] | None = None, enable_async: bool = False, experimental_skip_slot_variables: bool = False, experimental_sharding_callback=None, diff --git a/stubs/workalendar/workalendar/europe/__init__.pyi b/stubs/workalendar/workalendar/europe/__init__.pyi index b6abc88df1dc..946bd31565ac 100644 --- a/stubs/workalendar/workalendar/europe/__init__.pyi +++ b/stubs/workalendar/workalendar/europe/__init__.pyi @@ -249,7 +249,6 @@ __all__ = ( "Cantabria", "ValencianCommunity", # Switzerland - "Switzerland", "Aargau", "AppenzellInnerrhoden", "AppenzellAusserrhoden", diff --git a/stubs/yt-dlp/yt_dlp/update.pyi b/stubs/yt-dlp/yt_dlp/update.pyi index 70b7fae5ad66..b3fdc6694004 100644 --- a/stubs/yt-dlp/yt_dlp/update.pyi +++ b/stubs/yt-dlp/yt_dlp/update.pyi @@ -26,7 +26,7 @@ class Updater: @property def current_commit(self) -> str: ... def query_update(self, *, _output: bool = False) -> UpdateInfo | None: ... - def update(self, update_info: type[NO_DEFAULT] | None | UpdateInfo = ...) -> bool | None: ... + def update(self, update_info: type[NO_DEFAULT] | UpdateInfo | None = ...) -> bool | None: ... @functools.cached_property def filename(self) -> str: ... @functools.cached_property