summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/reference/datamodel.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 129f987..d01b1f2 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -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::