Skip to content

Make FFI.buffer actually implement buffer protocol #14505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions stubs/cffi/_cffi_backend.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,17 @@ class _CDataBase:
class buffer:
__hash__: ClassVar[None] # type: ignore[assignment]
def __init__(self, *args, **kwargs) -> None: ...
def __delitem__(self, other) -> None: ...
def __eq__(self, other): ...
def __ge__(self, other): ...
def __getitem__(self, index): ...
def __gt__(self, other): ...
def __le__(self, other): ...
def __buffer__(self, flags: int, /) -> memoryview: ...
def __delitem__(self, other, /) -> None: ...
def __eq__(self, other, /): ...
def __ge__(self, other, /): ...
def __getitem__(self, index, /): ...
def __gt__(self, other, /): ...
def __le__(self, other, /): ...
def __len__(self) -> int: ...
def __lt__(self, other): ...
def __ne__(self, other): ...
def __setitem__(self, index, object) -> None: ...
def __lt__(self, other, /): ...
def __ne__(self, other, /): ...
def __setitem__(self, index, object, /) -> None: ...

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