summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-10-25 04:03:51 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-10-25 04:03:51 (GMT)
commit1fafc1a11f7d4799f252a40e608b0fd4d4fedb68 (patch)
treee6ca35529a9643469f6840f49fa9359b555038d6
parentd6ca6c2b32118fec10d28b1a23d97f8e6b536d04 (diff)
downloadcpython-1fafc1a11f7d4799f252a40e608b0fd4d4fedb68.zip
cpython-1fafc1a11f7d4799f252a40e608b0fd4d4fedb68.tar.gz
cpython-1fafc1a11f7d4799f252a40e608b0fd4d4fedb68.tar.bz2
document __bytes__ special method (closes #13259)
-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::