]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
document __bytes__ special method (closes #13259)
authorBenjamin Peterson <benjamin@python.org>
Tue, 25 Oct 2011 04:03:51 +0000 (00:03 -0400)
committerBenjamin Peterson <benjamin@python.org>
Tue, 25 Oct 2011 04:03:51 +0000 (00:03 -0400)
Doc/reference/datamodel.rst

index 129f987a449932041ce7a572fb4c9f86a331c701..d01b1f2db250c41ef71219ea2508dd29d10352eb 100644 (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::