[Python-checkins] cpython (3.2): document __bytes__ special method (closes #13259)
benjamin.peterson
python-checkins at python.org
Tue Oct 25 06:07:17 CEST 2011
http://hg.python.org/cpython/rev/199d9e3fe0ce
changeset: 73111:199d9e3fe0ce
branch: 3.2
parent: 73097:d9571fb37269
user: Benjamin Peterson <benjamin at python.org>
date: Tue Oct 25 00:03:51 2011 -0400
summary:
document __bytes__ special method (closes #13259)
files:
Doc/reference/datamodel.rst | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -1157,6 +1157,14 @@
.. 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::
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list