17.10.17 09:42, Nick Coghlan пише:
On 17 October 2017 at 16:32, Nick Coghlan <ncogh...@gmail.com <mailto:ncogh...@gmail.com>> wrote:

    So this sounds like a reasonable API UX improvement to me, but you'd
    need to ensure that you don't inadvertently change the external
    behaviour of *successful* containment tests.


I should also note that there's another option here beyond just returning "False": it would also be reasonable to raise an exception like "RuntimeError('Attempted negative containment check on infinite iterator')".

What about other operations with infinite iterators? min(count()), max(count()), all(count(1))? Do you want to implement special cases for all of them?

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to