From: Benjamin Peterson Date: Tue, 25 Oct 2011 04:03:51 +0000 (-0400) Subject: document __bytes__ special method (closes #13259) X-Git-Tag: v3.2.3rc1~476 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1fafc1a11f7d4799f252a40e608b0fd4d4fedb68;p=thirdparty%2FPython%2Fcpython.git document __bytes__ special method (closes #13259) --- diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 129f987a4499..d01b1f2db250 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::