This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: __bytes__ not documented
Type: Stage: resolved
Components: Documentation Versions: Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, pitrou, python-dev, yak
Priority: normal Keywords:

Created on 2011-10-24 22:49 by yak, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg146334 - (view) Author: Arkadiusz Wahlig (yak) Date: 2011-10-24 22:49
It looks like Python 3 supports the __bytes__ magic method (called by bytes(obj)). However, it's not documented anywhere.

Also, I could not find any reference to BDFL accepting it but it looks like it got in anyway.

Here are some posts back from 2007 where he argues against it:
http://mail.python.org/pipermail/python-3000/2007-August/009375.html
msg146336 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-10-24 22:58
Indeed. I didn't even remember we had that. There are tests, however, in Lib/test/test_bytes.py.
This was added in issue #2415, by the way.
msg146342 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-10-25 04:07
New changeset 199d9e3fe0ce by Benjamin Peterson in branch '3.2':
document __bytes__ special method (closes #13259)
http://hg.python.org/cpython/rev/199d9e3fe0ce

New changeset 4128de054937 by Benjamin Peterson in branch 'default':
merge 3.2 (#13259)
http://hg.python.org/cpython/rev/4128de054937
History
Date User Action Args
2022-04-11 14:57:23adminsetgithub: 57468
2011-10-25 04:07:22python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg146342

resolution: fixed
stage: needs patch -> resolved
2011-10-24 22:58:09pitrousetversions: - Python 3.1, Python 3.4
nosy: + pitrou

messages: + msg146336

stage: needs patch
2011-10-24 22:49:05yakcreate