R. David Murray added the comment:

I think you change is appropriate given that the "equivalent to" for the built 
in iterators contains the 'is' expression.

However, I also think we should drop that second whole paragraph, and in the 
previous paragraph say "...but are :term:`iterable`...".  Because conceptually 
what we do is iterate whatever we're given if iter doesn't return a TypeError, 
and it is iter that handles the fallback to the older __getitem__ protocol.  I 
don't see why we should re-explain the iteration protocol in the docs for 'in'. 
 (I haven't looked at how this is actually implemented, but the implementation 
ought to be equivalent to that or we will eventually run into bugs.)  I don't 
think this would result in any loss of precision or understandability, and in 
fact I think it would make it easier to understand.

See also issue 27605, which also wants to edit this section slightly.

----------
nosy: +r.david.murray, rhettinger

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30969>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to