Use case: CGBitmapContextGetData returns a pointer to raw data, several MBs in size. I would like to pass it to NumPy for further processing. Currently, it gets converted into a tuple of millions of single-byte objects.
A simple solution would be adding a method
def as_bytes(self, count: int) -> bytes.
Another alternative is to implement Buffer Protocol