mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
document __bytes__ special method (closes #13259)
This commit is contained in:
parent
d6ca6c2b32
commit
1fafc1a11f
1 changed files with 8 additions and 0 deletions
|
@ -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::
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue