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: problems with help() documentation of __i*__ operators
Type: Stage:
Components: Documentation Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, eli.bendersky, ezio.melotti, python-dev
Priority: normal Keywords:

Created on 2011-10-12 16:22 by eli.bendersky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg145411 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-10-12 16:22
Report from Joao Carneiro in the docs@ maillist:

----------------------------

I would like to report that I found a mistake in the document of "help(set)".

In the document all the __i*__ methods are described exactly like the same methods without i before the name.

Copied from the document:
__ixor__(...)

    x.__ixor__(y) <==> x^y


__xor__(...)

    x.__xor__(y) <==> x^y


I suppose that the __ixor__ would mean x^=y and not x^y like the __xor__ method right?

This problem also occurs for:
__iand__
__ior__
__isub__

----------------------------

The report is on Python 3.2, but the problem also exists in 2.7

It appears that the problem's source is in Objects/typeobject.c, where the __i*__ operators are defined with the IBSLOT macro. The documentation string is the operator, passed to IBSLOT - for __ixor__ it's "^", while it should probably be "^="
msg147435 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-11-11 14:42
New changeset 369487785e9f by Eli Bendersky in branch '2.7':
Issue #13161: fix doc strings of __i*__ operators
http://hg.python.org/cpython/rev/369487785e9f
msg147436 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-11-11 14:52
New changeset 9fbaa190f011 by Eli Bendersky in branch '3.2':
Issue #13161: fix doc strings of __i*__ operators
http://hg.python.org/cpython/rev/9fbaa190f011

New changeset d58de3e9870a by Eli Bendersky in branch 'default':
Issue #13161: fix doc strings of __i*__ operators. Closes #13161
http://hg.python.org/cpython/rev/d58de3e9870a
History
Date User Action Args
2022-04-11 14:57:22adminsetgithub: 57370
2011-11-11 14:53:05eli.benderskysetstatus: open -> closed
2011-11-11 14:52:42python-devsetmessages: + msg147436
2011-11-11 14:42:41python-devsetnosy: + python-dev
messages: + msg147435
2011-10-26 04:32:56ezio.melottisetnosy: + ezio.melotti
2011-10-12 16:22:22eli.benderskycreate