Nathaniel Smith <[email protected]> added the comment:
The help for 'n' says:
(Pdb) help n
n(ext)
Continue execution until the next line in the current function
is reached or it returns.
(And the docs [1] say essentially the same.)
It sounds like if that were true, then you wouldn't have a problem, right? But
what it's actually doing is continuing until the next line in the current
function is reached, or it returns, *or it yields*.
It would be super helpful if pdb had a way to step past yields, running at full
speed until the current frame is resumed. And it's not just 'next' where this
would be useful, it's useful for 'step' and 'until' as well.
Furthermore, I think we should distinguish between the "user visible" yields in
generators and async generators, and the "implementation detail" yields to the
coroutine runner that are async functions do. In both cases you might want
stepping to follow the yield or not, so it'd be nice to have the option, but
the *default* for user-visible yields should be to treat the yield like a
return, and the *default* for implementation-detail yields should be to
continue until the frame is resumed again.
[1] https://docs.python.org/3.7/library/pdb.html#pdbcommand-next
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue32900>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com