[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.  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.

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.

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.
_______________________________________________
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/4EVEQZZPEPAGSJ25SSG2EQWQ3MUP2ZHW/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to