@@ -519,9 +519,8 @@ class`. In addition, it provides one more method:
519519 >>> int .from_bytes([255 , 0 , 0 ], byteorder = ' big' )
520520 16711680
521521
522- The argument *bytes * must either support the buffer protocol or be an
523- iterable producing bytes. :class: `bytes ` and :class: `bytearray ` are
524- examples of built-in objects that support the buffer protocol.
522+ The argument *bytes * must either be a :term: `bytes-like object ` or an
523+ iterable producing bytes.
525524
526525 The *byteorder * argument determines the byte order used to represent the
527526 integer. If *byteorder * is ``"big" ``, the most significant byte is at the
@@ -1417,10 +1416,9 @@ multiple fragments.
14171416 single: bytes; str (built-in class)
14181417
14191418 If at least one of *encoding * or *errors * is given, *object * should be a
1420- :class: `bytes ` or :class: `bytearray ` object, or more generally any object
1421- that supports the :ref: `buffer protocol <bufferobjects >`. In this case, if
1422- *object * is a :class: `bytes ` (or :class: `bytearray `) object, then
1423- ``str(bytes, encoding, errors) `` is equivalent to
1419+ :term: `bytes-like object ` (e.g. :class: `bytes ` or :class: `bytearray `). In
1420+ this case, if *object * is a :class: `bytes ` (or :class: `bytearray `) object,
1421+ then ``str(bytes, encoding, errors) `` is equivalent to
14241422 :meth: `bytes.decode(encoding, errors) <bytes.decode> `. Otherwise, the bytes
14251423 object underlying the buffer object is obtained before calling
14261424 :meth: `bytes.decode `. See :ref: `binaryseq ` and
0 commit comments