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.

Author terry.reedy
Recipients docs@python, madphysicist, r.david.murray, rhettinger, terry.reedy
Date 2017-07-29.01:59:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501293559.2.0.226846388631.issue31042@psf.upfronthosting.co.za>
In-reply-to
Content
To me, 'roughly' is wrong.  Either the equivalence is exact, or it is completely absent .  There is no 'nearly' or 'roughly' about this situation.

This is difference from  iterator_class_x(args) being mathematically equivalent to generator_function_y(args) in the sense of yielding *exactly* the same sequence of objects, but being different in the Python sense that type(iterator_class_x) != type(generator_function_y).  

Note: even in this case, I was once in favor of changing 'equivalent' to 'roughly equivalent' in the itertools doc.  I now regret that because 'roughly' could be misunderstood.  I think that 'mathematically equivalent' or 'equivalent when iterated' or 'equivalent*' would be better, with an explanatory note at the top.

As for this issue, __index__ is a reserved name.  https://docs.python.org/3/reference/lexical_analysis.html#reserved-classes-of-identifiers

a.__index__ = <whatever> is an unauthorized use of a *reserved* word and the effect of such usage is not and need not be documented.  

The entry for __*__ does include "*Any* use of __*__ names, in any context, that does not follow explicitly documented use, is subject to breakage without warning."  To me, that says that the effect of the reserved-word assignment is undefined.  It could be made to raise an exception.

To be even clearer, I believe we should explicitly state what I consider implicit: something like "Any such use breaks these manuals, in the sense that it may make statements herein untrue.  These manuals assume that reserved names are used as specified."
History
Date User Action Args
2017-07-29 01:59:19terry.reedysetrecipients: + terry.reedy, rhettinger, r.david.murray, docs@python, madphysicist
2017-07-29 01:59:19terry.reedysetmessageid: <1501293559.2.0.226846388631.issue31042@psf.upfronthosting.co.za>
2017-07-29 01:59:19terry.reedylinkissue31042 messages
2017-07-29 01:59:17terry.reedycreate