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

Ethan Furman report at bugs.python.org
Wed Mar 12 11:29:57 CET 2014


New submission from Ethan Furman:

`bytes` is a list of integers.  Passing a single integer to `bytes()`, as in:

   --> bytes(7)
   b'\x00\x00\x00\x00\x00\x00\x00'

results in a bytes object containing that many zeroes.

I propose that this behavior be deprecated for eventual removal, and a class method be created to take its place.

----------
components: Interpreter Core
messages: 213242
nosy: ethan.furman
priority: normal
severity: normal
status: open
title: Add bytes.empty_buffer and deprecate bytes(17) for the same purpose
type: behavior
versions: Python 3.5

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


More information about the New-bugs-announce mailing list