quick2wire/quick2wire-python-api — pull request #32 by npryce (2013-02-16 14:15:57+00:00)
Title: Improved I2C read API to reduce memory allocation and copying.

Removed reading(size), replaced with reading_into(buf), where buf is a mutable buffer (e.g. bytearray or ctype struct). This allows client code to control when the buffer is allocated and reuse buffers between I2C transactions, so reducing memory allocation overhead. The I2C data is read directly into the buffer, not copied from a ctypes stringbuffer into a pure Python byte buffer, so reducing memory copying overhead.