As you can see map() ignores the Exception and instead stops iterating on the first loop.
It seems like it simply mistakes the Exception raised from the function with the one from the Iterator, so it thinks its supposed to stop iterating, and therefore it quits early.
In fact if we overwrite the map() function like so, it will raise it properly:
For those wondering how I came across this bug, it happened when I was calling next() on a bunch of iterators,
which as you can see, made an infinite loop since map() would confuse the Exception raised from next() of the function that was passed with next() when iterating through the iterable that was passed to map()
shner-elmo commentedDec 8, 2022
Bug report
As you can see
map()
ignores the Exception and instead stops iterating on the first loop.It seems like it simply mistakes the Exception raised from the function with the one from the Iterator, so it thinks its supposed to stop iterating, and therefore it quits early.
In fact if we overwrite the
map()
function like so, it will raise it properly:But when call the function directly on the
next()
element then the same thing happensFor those wondering how I came across this bug, it happened when I was calling
next()
on a bunch of iterators,which as you can see, made an infinite loop since
map()
would confuse the Exception raised fromnext()
of the function that was passed withnext()
when iterating through the iterable that was passed tomap()
Your environment
3.10.7
Windows-10
,AMD64
,64bit
The text was updated successfully, but these errors were encountered: