11 Dec
2019
11 Dec
'19
4:20 p.m.
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