<p dir="ltr"><br>
On 18 Aug 2014 09:41, "Raymond Hettinger" <<a href="mailto:raymond.hettinger@gmail.com">raymond.hettinger@gmail.com</a>> wrote:<br>
><br>
><br>
> I encourage restraint against adding an unneeded class method that has no parallel<br>
> elsewhere.  Right now, the learning curve is mitigated because bytes is very str-like<br>
> and because bytearray is list-like (i.e. the method names have been used elsewhere<br>
> and likely already learned before encountering bytes() or bytearray()).  Putting in new,<br>
> rarely used funky method adds to the learning burden.<br>
><br>
> If you do press forward with adding it (and I don't see why), then as an alternate <br>
> constructor, the name should be from_int() or some such to avoid ambiguity<br>
> and to make clear that it is a class method.</p>
<p dir="ltr">If I remember the sequence of events correctly, I thought of map(bytes.byte, data) first, and then Guido suggested a dedicated iterbytes() method later.</p>
<p dir="ltr">The step I hadn't taken (until now) was realising that the new memoryview(data).iterbytes() capability actually combines with the existing (bytes([b]) for b in data) to make the original bytes.byte idea unnecessary.</p>

<p dir="ltr">Cheers,<br>
Nick.</p>