document __bytes__ special method (closes #13259)

This commit is contained in:
Benjamin Peterson 2011-10-25 00:03:51 -04:00
parent d6ca6c2b32
commit 1fafc1a11f

View file

@ -1157,6 +1157,14 @@ Basic customization
.. XXX what about subclasses of string?
.. method:: object.__bytes__(self)
.. index:: builtin: bytes
Called by :func:`bytes` to compute a byte-string representation of an
object. This should return a ``bytes`` object.
.. method:: object.__format__(self, format_spec)
.. index::