Skip to content

Commit 0b08854

Browse files
committed
fix(pagination): drop @overload stubs to resolve D105/D418 pydocstyle conflict
pydocstyle D105 requires docstrings on magic methods but D418 prohibits docstrings on @overload stubs — these rules are irreconcilable for @overload-decorated __getitem__. Since PaginationList is the only file in the project using @overload, there is no established project pattern. Drop the two stubs and keep only the concrete implementation with its existing docstring. The union signature 'SupportsIndex | slice -> T | list[T]' is correct; callers lose the narrowed return type but the runtime behaviour is unchanged. Also removes the now-unused 'overload' import.
1 parent 10c2ba0 commit 0b08854

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

‎pyiceberg/utils/pagination.py‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from __future__ import annotations
2121

2222
from collections.abc import Callable, Iterator
23-
from typing import SupportsIndex, TypeVar, overload
23+
from typing import SupportsIndex, TypeVar
2424

2525
T = TypeVar("T")
2626

@@ -116,12 +116,6 @@ def __ne__(self, other: object) -> bool:
116116
# Index / slice access
117117
# ------------------------------------------------------------------
118118

119-
@overload
120-
def __getitem__(self, idx: SupportsIndex) -> T: ... # noqa: D105
121-
122-
@overload
123-
def __getitem__(self, idx: slice) -> list[T]: ... # noqa: D105
124-
125119
def __getitem__(self, idx: SupportsIndex | slice) -> T | list[T]:
126120
"""Fetch pages as needed before returning the requested item(s)."""
127121
if isinstance(idx, slice):

0 commit comments

Comments
 (0)