A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-August/135795.html below:

Minor API improvements for bytes & bytearray

[Python-Dev] PEP 467: Minor API improvements for bytes & bytearrayVictor Stinner victor.stinner at gmail.com
Fri Aug 15 21:55:46 CEST 2014
2014-08-15 7:50 GMT+02:00 Nick Coghlan <ncoghlan at gmail.com>:
> As far as I am aware, that last item poses the only open question,
> with the alternative being to add an "iterbytes" builtin (...)

Do you have examples of use cases for a builtin function? I only found
5 usages of bytes((byte,)) constructor in the standard library:

$ grep -E 'bytes\(\([^)]+, *\)\)' $(find -name "*.py")
./Lib/quopri.py:            c = bytes((c,))
./Lib/quopri.py:        c = bytes((c,))
./Lib/base64.py:        b32tab = [bytes((i,)) for i in _b32alphabet]
./Lib/base64.py:        _a85chars = [bytes((i,)) for i in range(33, 118)]
./Lib/base64.py:        _b85chars = [bytes((i,)) for i in _b85alphabet]

bytes.iterbytes() can be used in 4 cases on 5. Adding a new builtin
for a single line in the whole standard library doesn't look right.

Victor
More information about the Python-Dev mailing list

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