调试时掉帧?

Drop frame while debugging?

我想知道 PyCharm / Intellij 中 Python 插件是否可以使用丢帧。

这是按钮的样子(它没有出现在调试工具栏上,所以我假设它不适用于 PyCharm)--> How to step one step back in IntelliJ?

我正在尝试做的是当我看到一个问题时重新播放一个函数,以便更多地检查它。 ("come back in time")

(我之前在 Eclipse 中使用过 Java,如果您编辑它并保存更改,它会重播当前范围。当然全局范围保持 changed after 运行 一个函数很多次,但对于大多数情况它是非常有用的)

谢谢告知!

既然您想 're-ply a function','Evaluate Expression' 就非常适合这个目的。我在调试时使用了很多。它基本上允许在 运行 时间使用该上下文中的变量和函数 运行 任何代码。

是debug上最右边的图标window。

在出错的那一行之前打个断点,调试程序,当遇到断点时,点击'Evaluate Expression'图标,复制有问题的函数,粘贴,运行它。

PyCharm 2017.2 似乎添加了您正在寻找的功能。 documentation 在调试步进工具栏上描述了一个 "Drop frame button":

Interrupts execution and returns to the initial point of method execution. In the process, it drops the current method frames from the stack.

从 2017.3.3 版本开始,没有 IntelliJ 中的丢帧功能。上面提到的 pycharm 文档似乎是错误的。