diff --git a/peps/pep-0467.rst b/peps/pep-0467.rst index 4cdcfe327..033ce087a 100644 --- a/peps/pep-0467.rst +++ b/peps/pep-0467.rst @@ -16,7 +16,7 @@ Post-History: 30-Mar-2014, 15-Aug-2014, 16-Aug-2014, 07-Jun-2016, 01-Sep-2016, Abstract ======== -This PEP proposes five small adjustments to the APIs of the ``bytes`` and +This PEP proposes small adjustments to the APIs of the ``bytes`` and ``bytearray`` types to make it easier to operate entirely in the binary domain: * Add ``fromsize`` alternative constructor @@ -56,10 +56,12 @@ Proposals Addition of explicit "count and byte initialised sequence" constructors ----------------------------------------------------------------------- -To replace the now discouraged behavior, this PEP proposes the addition of an -explicit ``fromsize`` alternative constructor as a class method on both -``bytes`` and ``bytearray`` whose first argument is the count, and whose -second argument is the fill byte to use (defaults to ``\x00``):: +To replace the discouraged behavior of creating zero-filled ``bytes``-like +objects from the basic constructors (i.e. ``bytes(1)`` --> ``b'\x00'``), this +PEP proposes the addition of an explicit ``fromsize`` alternative constructor +as a class method on both ``bytes`` and ``bytearray`` whose first argument +is the count, and whose second argument is the fill byte to use (defaults +to ``\x00``):: >>> bytes.fromsize(3) b'\x00\x00\x00'