[New-bugs-announce] [issue33323] inconsistent stack trace for exceptions thrown in generators passed to min/max

Naris R report at bugs.python.org
Sat Apr 21 06:53:20 EDT 2018


New submission from Naris R <nariscatboy at gmail.com>:

if a generator passed to min/max throws an exception, the stack trace is normally shown on the line that caused the exception, but if the exception is a StopIteration, the trace only shows the line where the max/min function was called.

I was writing a minimax and alphabeta search with generator expression and list comprehension and accidentally passed an empty iterator to the next function while computing states for minimax and it took a very long time to find out where the error was actually caused.

----------
messages: 315561
nosy: Naris R
priority: normal
severity: normal
status: open
title: inconsistent stack trace for exceptions thrown in generators passed to min/max
type: behavior
versions: Python 2.7, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33323>
_______________________________________


More information about the New-bugs-announce mailing list