Use PEP 688 (#10225)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Jelle Zijlstra
2023-05-27 19:55:30 -07:00
committed by GitHub
parent 56aeeb677f
commit c0a0c34020
16 changed files with 80 additions and 64 deletions

View File

@@ -398,4 +398,8 @@ else:
def __or__(self, right: Any) -> _SpecialForm: ...
def __ror__(self, left: Any) -> _SpecialForm: ...
class Buffer(abc.ABC): ...
@runtime_checkable
class Buffer(Protocol):
# Not actually a Protocol at runtime; see
# https://github.com/python/typeshed/issues/10224 for why we're defining it this way
def __buffer__(self, __flags: int) -> memoryview: ...