Skip to content

Commit 32bc5fc

Browse files
authored
Make FFI.buffer implement buffer protocol, mark dunder methods as positional-only (#14505)
1 parent 5a5d6a7 commit 32bc5fc

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

stubs/cffi/_cffi_backend.pyi

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,17 @@ class _CDataBase:
9090
class buffer:
9191
__hash__: ClassVar[None] # type: ignore[assignment]
9292
def __init__(self, *args, **kwargs) -> None: ...
93-
def __delitem__(self, other) -> None: ...
94-
def __eq__(self, other): ...
95-
def __ge__(self, other): ...
96-
def __getitem__(self, index): ...
97-
def __gt__(self, other): ...
98-
def __le__(self, other): ...
93+
def __buffer__(self, flags: int, /) -> memoryview: ...
94+
def __delitem__(self, other, /) -> None: ...
95+
def __eq__(self, other, /): ...
96+
def __ge__(self, other, /): ...
97+
def __getitem__(self, index, /): ...
98+
def __gt__(self, other, /): ...
99+
def __le__(self, other, /): ...
99100
def __len__(self) -> int: ...
100-
def __lt__(self, other): ...
101-
def __ne__(self, other): ...
102-
def __setitem__(self, index, object) -> None: ...
101+
def __lt__(self, other, /): ...
102+
def __ne__(self, other, /): ...
103+
def __setitem__(self, index, object, /) -> None: ...
103104

104105
# These aliases are to work around pyright complaints.
105106
# Pyright doesn't like it when a class object is defined as an alias

0 commit comments

Comments
 (0)