We had several typeshed issues and pull requests lately that try to work around the fact that there is no way to express that a method receives any object following the buffer protocol. The typing documentation mentions BytesType ByteString, which is an alias for Union[bytes, memoryview, bytearray] (and that bytes can be used as an alias in argument types), but this is missing other types such as array.array or user-defined objects. As this is a C API protocol, just defining such a protocol in typeshed in not possible.
We had several typeshed issues and pull requests lately that try to work around the fact that there is no way to express that a method receives any object following the buffer protocol. The typing documentation mentions
BytesTypeByteString, which is an alias forUnion[bytes, memoryview, bytearray](and thatbytescan be used as an alias in argument types), but this is missing other types such asarray.arrayor user-defined objects. As this is a C API protocol, just defining such a protocol in typeshed in not possible.