Requiring the array.array to be exactly the right length means that if the messages have different numbers of pulses, there's going to be a lot of memory reallocation going on, potentially on quite large objects. An optional count argument would allow reuse of the same memory allocation for each message.
Requiring the array.array to be exactly the right length means that if the messages have different numbers of pulses, there's going to be a lot of memory reallocation going on, potentially on quite large objects. An optional count argument would allow reuse of the same memory allocation for each message.