diff -r ebb23744a36c Doc/library/stdtypes.rst --- a/Doc/library/stdtypes.rst Wed Aug 31 23:00:32 2016 -0700 +++ b/Doc/library/stdtypes.rst Thu Sep 01 07:07:37 2016 +0000 @@ -2298,8 +2298,11 @@ In addition to the literal forms, bytes other ways: * A zero-filled bytes object of a specified length: ``bytes(10)`` + (deprecated in version 3.6) * From an iterable of integers: ``bytes(range(20))`` * Copying existing binary data via the buffer protocol: ``bytes(obj)`` +* Using the :meth:`~bytes.zeros` constructor: ``bytes.zeros(10)`` +* Using the :meth:`~bytes.byte` single-byte constructor: ``bytes.byte(65)`` Also see the :ref:`bytes ` built-in. @@ -2362,8 +2365,11 @@ they are always created by calling the c * Creating an empty instance: ``bytearray()`` * Creating a zero-filled instance with a given length: ``bytearray(10)`` + (deprecated in version 3.6) * From an iterable of integers: ``bytearray(range(20))`` * Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')`` +* Using the :meth:`~bytearray.zeros` constructor: ``bytearray.zeros(10)`` +* Using the :meth:`~bytearray.byte` single-byte constructor: ``bytearray.byte(65)`` As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the @@ -2530,6 +2536,14 @@ arbitrary binary data. Also accept an integer in the range 0 to 255 as the subsequence. +.. classmethod:: bytes.iterbytes() + bytearray.iterbytes() + + Return an iterator that produce :class:`bytes` objects of length 1. + + .. versionadded:: 3.6 + + .. method:: bytes.join(iterable) bytearray.join(iterable) @@ -3667,6 +3681,12 @@ copying. .. versionchanged:: 3.5 The source format is no longer restricted when casting to a byte view. + .. classmethod:: memoryview.iterbytes() + + Return an iterator that produce :class:`bytes` objects of length 1. + + .. versionadded:: 3.6 + There are also several readonly attributes available: .. attribute:: obj