doceme / py-spidev

MIT License
461 stars 203 forks source link

Support binary sequence data via Buffer Protocol instead of list conversion (feature request) #65

Open gnbl opened 7 years ago

gnbl commented 7 years ago

It seems writebytes() optionally converts the sequence data to a list and then copies this data to a C-type buffer which then is written to the SPI device.

The Python 3 Buffer Protocol could be used to avoid the list conversion and of data types such as bytes (immutable) or bytearray (mutable).