gpt4 book ai didi

python - 如何跳过 Python 调试器 (pdb) 中的列表理解?

转载 作者:IT老高 更新时间:2023-10-28 20:32:00 27 4
gpt4 key购买 nike

pdb 中,next 指令不会跳过列表推导,而是逐步完成每次迭代。有没有办法跳过它们,以便在列表理解后的下一行继续调试?

我不得不求助于列出代码,在下一行设置断点,然后继续执行到下一个断点。这很烦人,我想一定有更好的方法。

最佳答案

您可以使用 until 命令。 pdbhelp until的输出:

unt(il)
Continue execution until the line with a number greater than the current one is reached or until the current frame returns

关于python - 如何跳过 Python 调试器 (pdb) 中的列表理解?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6308569/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com