Skip to content

Commit 67e1781

Browse files
j-t-1stefan6419846
andauthored
DEV: Remove ignore Ruff rule ANN202 (#3100)
ANN202: Missing return type annotation for private function. --------- Co-authored-by: Stefan <96178532+stefan6419846@users.noreply.github.com>
1 parent c78f68d commit 67e1781

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pypdf/_utils.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
else:
5757
from typing_extensions import TypeAlias
5858

59+
if sys.version_info >= (3, 11):
60+
from typing import Self
61+
else:
62+
from typing_extensions import Self
63+
5964
from .errors import (
6065
STREAM_TRUNCATED_PREMATURELY,
6166
DeprecationError,
@@ -477,6 +482,7 @@ def _human_readable_bytes(bytes: int) -> str:
477482

478483
# The following class has been copied from Django:
479484
# https://github.com/django/django/blob/adae619426b6f50046b3daaa744db52989c9d6db/django/utils/functional.py#L51-L65
485+
# It received some modifications to comply with our own coding standards.
480486
#
481487
# Original license:
482488
#
@@ -521,7 +527,7 @@ def __init__(self, method=None) -> None: # type: ignore # noqa: ANN001
521527
def __get__(self, instance, cls=None) -> Any: # type: ignore # noqa: ANN001
522528
return self.fget(cls)
523529

524-
def getter(self, method): # type: ignore # noqa: ANN001, ANN202
530+
def getter(self, method) -> Self: # type: ignore # noqa: ANN001
525531
self.fget = method
526532
return self
527533

setup.cfg

-6
This file was deleted.

0 commit comments

Comments
 (0)