On 12/12/19 4:39 am, Daniel Moisset wrote:
I think a solution nobody has proposed in this thread is relaxing the next builtin, so it calls iter() on the argument when it doesn't implement the iterator protocol.
> Do you think this fails to cover the > original problems in any way?
It would still raise StopIteration if the iterator is empty and no default is specified. Part of the problem being addressed is that this has a tendency to turn obvious bugs into non-obvious ones. -- Greg _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/6UKORRT4KR7PDJJH3MYNU5R2HZLDWPAM/ Code of Conduct: http://python.org/psf/codeofconduct/