On 1/24/2020 8:43 PM, Tim Peters wrote:
[Terry Reedy <tjre...@udel.edu>]
]& skipping all the parts I agree with]
...
Covered by "For user-defined classes which do not define __contains__()
but do define __iter__(), x in y is True if some value z, for which the
expression x is z or x == z is true, is produced while iterating over y.
" in
https://docs.python.org/3/reference/expressions.html#membership-test-operations
Just went through that with Serhiy.
I saw that after hitting send.
Very briefly, two problems:
1. Those docs are over-specified if we intend that the "x is z" is an
implementation choice rather than a language requirement.
My interpretation of Guido's comments is that 'implementation choice'
was his intention, so that 'language requirement' would be a change.
2. Repeating all that stuff all over the docs is a PITA, error-prone,
and ugly, since contexts that call PyObject_RichCompareBool() under
the covers are all over the place too.
The idiom is repeated 3 times just in the 'in' discusion.
Document it carefully in _one_ place (the Reference Manual already has
your good start), and just plant links to that in high-value locations
elsewhere in the docs.
Yes.
--
Terry Jan Reedy
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/TJFTYP2FO5M754D6S37ZZTPVQAIKH64H/
Code of Conduct: http://python.org/psf/codeofconduct/