On 18 Aug 2014 09:41, "Raymond Hettinger" <raymond.hettinger at gmail.com> wrote: > > > I encourage restraint against adding an unneeded class method that has no parallel > elsewhere. Right now, the learning curve is mitigated because bytes is very str-like > and because bytearray is list-like (i.e. the method names have been used elsewhere > and likely already learned before encountering bytes() or bytearray()). Putting in new, > rarely used funky method adds to the learning burden. > > If you do press forward with adding it (and I don't see why), then as an alternate > constructor, the name should be from_int() or some such to avoid ambiguity > and to make clear that it is a class method. 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. 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. Cheers, Nick. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20140818/529ee30b/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4