diff --git a/python/stubs/__lib_pxi/array.pyi b/python/stubs/__lib_pxi/array.pyi index ec1cda30a88..17eb4c6d888 100644 --- a/python/stubs/__lib_pxi/array.pyi +++ b/python/stubs/__lib_pxi/array.pyi @@ -1,3 +1,4 @@ +import builtins import datetime as dt import sys @@ -1990,8 +1991,7 @@ class Array(_PandasConvertible[pd.Series], Generic[_Scalar_co]): @overload def __getitem__(self, key: int) -> _Scalar_co: ... @overload - def __getitem__(self, key: slice) -> Self: ... - def __getitem__(self, key): + def __getitem__(self, key: builtins.slice) -> Self: ... """ Slice or return value at given index diff --git a/python/stubs/__lib_pxi/io.pyi b/python/stubs/__lib_pxi/io.pyi index d882fd79d57..37c8aefb06b 100644 --- a/python/stubs/__lib_pxi/io.pyi +++ b/python/stubs/__lib_pxi/io.pyi @@ -1,3 +1,4 @@ +import builtins import sys from collections.abc import Callable @@ -578,7 +579,7 @@ class Buffer(_Weakrefable): @property def parent(self) -> Buffer | None: ... @overload - def __getitem__(self, key: slice) -> Self: ... + def __getitem__(self, key: builtins.slice) -> Self: ... @overload def __getitem__(self, key: int) -> int: ... def slice(self, offset: int = 0, length: int | None = None) -> Self: diff --git a/python/stubs/__lib_pxi/table.pyi b/python/stubs/__lib_pxi/table.pyi index ad9d0392137..ad34e9b6dff 100644 --- a/python/stubs/__lib_pxi/table.pyi +++ b/python/stubs/__lib_pxi/table.pyi @@ -1,3 +1,4 @@ +import builtins import datetime as dt import sys @@ -294,7 +295,7 @@ class ChunkedArray(_PandasConvertible[pd.Series], Generic[_Scalar_co]): """ def __sizeof__(self) -> int: ... @overload - def __getitem__(self, key: slice) -> Self: ... + def __getitem__(self, key: builtins.slice) -> Self: ... @overload def __getitem__(self, key: int) -> _Scalar_co: ... def __getitem__(self, key): diff --git a/python/stubs/compute.pyi b/python/stubs/compute.pyi index 8d8fc35b134..f9039731ee6 100644 --- a/python/stubs/compute.pyi +++ b/python/stubs/compute.pyi @@ -93,6 +93,7 @@ from . import lib _P = ParamSpec("_P") _R = TypeVar("_R") +_CallableType = Callable[_P, _R] def field(*name_or_index: str | tuple[str, ...] | int) -> Expression: """Reference a column of the dataset. @@ -156,7 +157,7 @@ def scalar(value: bool | float | str) -> Expression: An Expression representing the scalar value """ -def _clone_signature(f: Callable[_P, _R]) -> Callable[_P, _R]: ... +def _clone_signature(f: _CallableType) -> _CallableType: ... # ============= compute functions ============= _DataTypeT = TypeVar("_DataTypeT", bound=lib.DataType)