Issue 13161: problems with help() documentation of i* operators (original) (raw)

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 "^="