From 4fcd58cc369dd47d9579dcb5ee37de85d623ba6a Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 26 Dec 2024 14:29:17 -0500 Subject: [PATCH 1/3] Enable Pylint Error --- pyproject.toml | 1 + stubs/gevent/gevent/hub.pyi | 2 +- stubs/regex/regex/regex.pyi | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 501066318b0b..4b7f7f574efe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ select = [ "B", # flake8-bugbear "FA", # flake8-future-annotations "I", # isort + "PLE", # Pylint Error "RUF", # Ruff-specific and unused-noqa "UP", # pyupgrade # Flake8 base rules diff --git a/stubs/gevent/gevent/hub.pyi b/stubs/gevent/gevent/hub.pyi index b949c9817ae0..44a8282ae316 100644 --- a/stubs/gevent/gevent/hub.pyi +++ b/stubs/gevent/gevent/hub.pyi @@ -29,7 +29,7 @@ class _DefaultReturnProperty(Protocol[_T]): @overload def __get__(self, obj: object, owner: type[object] | None = None) -> _T: ... def __set__(self, obj: object, value: _T | None) -> None: ... - def __del__(self, obj: object) -> None: ... + def __del__(self) -> None: ... def spawn_raw(function: Callable[..., object], *args: object, **kwargs: object) -> greenlet.greenlet: ... def sleep(seconds: float = 0, ref: bool = True) -> None: ... diff --git a/stubs/regex/regex/regex.pyi b/stubs/regex/regex/regex.pyi index 8b35a370ad8c..da239951345d 100644 --- a/stubs/regex/regex/regex.pyi +++ b/stubs/regex/regex/regex.pyi @@ -568,7 +568,7 @@ class Pattern(Generic[AnyStr]): timeout: float | None = None, ) -> _regex.Scanner[bytes]: ... def __copy__(self) -> Self: ... - def __deepcopy__(self) -> Self: ... + def __deepcopy__(self, memo) -> Self: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... @@ -647,6 +647,6 @@ class Match(Generic[AnyStr]): @overload def __getitem__(self, key: int | str, /) -> AnyStr | Any: ... def __copy__(self) -> Self: ... - def __deepcopy__(self) -> Self: ... + def __deepcopy__(self, memo) -> Self: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... From c76de6ef8fe42b0633d45a7facfeeb9caf8381bd Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 26 Dec 2024 15:08:20 -0500 Subject: [PATCH 2/3] type __deepcopy__ param --- stubs/regex/regex/regex.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stubs/regex/regex/regex.pyi b/stubs/regex/regex/regex.pyi index da239951345d..d80cd3978b85 100644 --- a/stubs/regex/regex/regex.pyi +++ b/stubs/regex/regex/regex.pyi @@ -1,5 +1,5 @@ import sys -from _typeshed import ReadableBuffer +from _typeshed import ReadableBuffer, Unused from collections.abc import Callable, Mapping from typing import Any, AnyStr, Generic, Literal, TypeVar, final, overload from typing_extensions import Self @@ -568,7 +568,7 @@ class Pattern(Generic[AnyStr]): timeout: float | None = None, ) -> _regex.Scanner[bytes]: ... def __copy__(self) -> Self: ... - def __deepcopy__(self, memo) -> Self: ... + def __deepcopy__(self, /, memo: Unused) -> Self: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... @@ -647,6 +647,6 @@ class Match(Generic[AnyStr]): @overload def __getitem__(self, key: int | str, /) -> AnyStr | Any: ... def __copy__(self) -> Self: ... - def __deepcopy__(self, memo) -> Self: ... + def __deepcopy__(self, /, memo: Unused) -> Self: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... From e2b29b3cd1284033c239e5a14b7285b1d8f8e39b Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 26 Dec 2024 16:51:10 -0500 Subject: [PATCH 3/3] Apply suggestions from code review --- stubs/regex/regex/regex.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/regex/regex/regex.pyi b/stubs/regex/regex/regex.pyi index d80cd3978b85..07b11b145dbb 100644 --- a/stubs/regex/regex/regex.pyi +++ b/stubs/regex/regex/regex.pyi @@ -568,7 +568,7 @@ class Pattern(Generic[AnyStr]): timeout: float | None = None, ) -> _regex.Scanner[bytes]: ... def __copy__(self) -> Self: ... - def __deepcopy__(self, /, memo: Unused) -> Self: ... + def __deepcopy__(self, memo: Unused, /) -> Self: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... @@ -647,6 +647,6 @@ class Match(Generic[AnyStr]): @overload def __getitem__(self, key: int | str, /) -> AnyStr | Any: ... def __copy__(self) -> Self: ... - def __deepcopy__(self, /, memo: Unused) -> Self: ... + def __deepcopy__(self, memo: Unused, /) -> Self: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...