From ca3611238bb821e332e0d68402ee0f05d065c08a Mon Sep 17 00:00:00 2001 From: Francesc Elies Date: Thu, 27 Apr 2023 08:14:54 +0300 Subject: [PATCH] cffi: improve getitem and setitem (#9968) Co-authored-by: Jelle Zijlstra --- stubs/cffi/_cffi_backend.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stubs/cffi/_cffi_backend.pyi b/stubs/cffi/_cffi_backend.pyi index 5724b092d..89130d0b5 100644 --- a/stubs/cffi/_cffi_backend.pyi +++ b/stubs/cffi/_cffi_backend.pyi @@ -3,7 +3,7 @@ import types from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer from collections.abc import Callable, Hashable from typing import Any, ClassVar, Protocol, TypeVar, overload -from typing_extensions import Literal, TypeAlias, final +from typing_extensions import Literal, SupportsIndex, TypeAlias, final _T = TypeVar("_T") @@ -72,7 +72,7 @@ class _CDataBase: def __exit__(self, type: type[BaseException] | None, value: BaseException | None, traceback: types.TracebackType | None): ... def __float__(self) -> float: ... def __ge__(self, other): ... - def __getitem__(self, index): ... + def __getitem__(self, index: SupportsIndex | slice): ... def __gt__(self, other): ... def __hash__(self) -> int: ... def __int__(self) -> int: ... @@ -83,7 +83,7 @@ class _CDataBase: def __ne__(self, other): ... def __radd__(self, other): ... def __rsub__(self, other): ... - def __setitem__(self, index, object) -> None: ... + def __setitem__(self, index: SupportsIndex | slice, object: Incomplete) -> None: ... def __sub__(self, other): ... @final