From ddb9163e7df9dda367bc6541fd521d306e624e70 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Thu, 25 Jul 2024 14:32:11 +0200 Subject: [PATCH] Update pyright to 1.1.372 (#12427) --- requirements-tests.txt | 2 +- stdlib/pathlib.pyi | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index 35b315d0e..5b16f2a6b 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -7,7 +7,7 @@ flake8-noqa==1.4.0 # must match .pre-commit-config.yaml flake8-pyi==24.6.0 # must match .pre-commit-config.yaml mypy==1.10.1 pre-commit-hooks==4.6.0 # must match .pre-commit-config.yaml -pyright==1.1.372 +pyright==1.1.373 pytype==2024.4.11; platform_system != "Windows" and python_version < "3.12" ruff==0.5.4 # must match .pre-commit-config.yaml diff --git a/stdlib/pathlib.pyi b/stdlib/pathlib.pyi index dfa6648e7..116bf6431 100644 --- a/stdlib/pathlib.pyi +++ b/stdlib/pathlib.pyi @@ -49,7 +49,7 @@ class PurePath(PathLike[str]): def stem(self) -> str: ... if sys.version_info >= (3, 12): def __new__(cls, *args: StrPath, **kwargs: Unused) -> Self: ... - def __init__(self, *args: StrPath) -> None: ... + def __init__(self, *args: StrPath) -> None: ... # pyright: ignore[reportInconsistentConstructor] else: def __new__(cls, *args: StrPath) -> Self: ... @@ -101,7 +101,11 @@ class PurePosixPath(PurePath): ... class PureWindowsPath(PurePath): ... class Path(PurePath): - def __new__(cls, *args: StrPath, **kwargs: Any) -> Self: ... + if sys.version_info >= (3, 12): + def __new__(cls, *args: StrPath, **kwargs: Unused) -> Self: ... # pyright: ignore[reportInconsistentConstructor] + else: + def __new__(cls, *args: StrPath, **kwargs: Unused) -> Self: ... + @classmethod def cwd(cls) -> Self: ... if sys.version_info >= (3, 10):