18 Aug
2011
18 Aug
'11
8:25 p.m.
Antoine Pitrou <solipsis@pitrou.net> wrote:
(I personnaly think the general bytes-as-sequence-of-ints behaviour is a mistake, so I wouldn't care much about an additional C API to enforce that behaviour :-))
I don't want to abolish the "c" (bytes of length 1) format. :) I think there are use cases for well defined arrays of small signed/unsigned integers. Say you want to send a log-ngram array of unsigned chars over the network. There shouldn't be a bytes object involved in that process. You would pack the array with ints and unpack as ints. Unless the struct module and PEP-3118 grow support for int8_t and uint8_t, I think "b" and "B" should probably be restricted to integers. Stefan Krah