[issue20895] Add bytes.empty_buffer and deprecate bytes(17) for the same purpose

Josh Rosenberg report at bugs.python.org
Sat Mar 29 01:35:36 CET 2014


Josh Rosenberg added the comment:

Why would we need bytes.fill(length, value)? Is b'\xVV' * length (or if value is a variable containing int, bytes((value,)) * length) unreasonable? Similarly, bytearray(b'\xVV) * length or bytearray((value,)) * length is both Pythonic and performant. Most sequences support multiplication so simple stuff like this can be done easily and consistently; why invent a new approach unique to bytes/bytearrays?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20895>
_______________________________________


More information about the Python-bugs-list mailing list