Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:

Converting *all* exceptions into RuntimeError is certainly not a good idea, 
especially since you include KeyboardInterrupt and other non-errors.

I'm probably going to be on the losing side of this one (I lost the argument 
back when a similar issue was raised about comprehensions), but I argue that 
this is not a bug it is a useful feature.

Having the map function raise StopIteration is a good way for the map to halt 
the loop early, when it detects a special sentinel or condition. A few years 
ago the change to comprehensions broke my code so I changed to map, and now you 
want to break it again :-(

----------
nosy: +steven.daprano

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

Reply via email to