diff options
| author | Benjamin Peterson <benjamin@python.org> | 2011-10-25 00:03:51 -0400 |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2011-10-25 00:03:51 -0400 |
| commit | 1fafc1a11f7d4799f252a40e608b0fd4d4fedb68 (patch) | |
| tree | e6ca35529a9643469f6840f49fa9359b555038d6 /Doc | |
| parent | d6ca6c2b32118fec10d28b1a23d97f8e6b536d04 (diff) | |
| download | cpython-git-1fafc1a11f7d4799f252a40e608b0fd4d4fedb68.tar.gz | |
document __bytes__ special method (closes #13259)
Diffstat (limited to 'Doc')
| -rw-r--r-- | Doc/reference/datamodel.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 129f987a44..d01b1f2db2 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:: |
