
March 28, 2014
2:15 p.m.
28.03.14 19:06, Benjamin Peterson написав(ла):
Antoine Pitrou <solipsis@...> writes:
I don't like it, but I also don't think it's enough of a nuisance to be deprecated. (the indexing behaviour of bytes objects is far more annoying)
I agree. We would add a method that iterates over single bytes as bytes objects instead of integers.
More general function can be used instead. def chunks(seq, size): for i in range(0, len(seq), size): yield seq[i: i + size]
list(chunks(b'abc', 1)) [b'a', b'b', b'c']