1
我很惊讶地发现,断点的存在可以改变一个pyqtgraph对象(python2.7)的行为。pyqtgraph古怪与pdb一起使用
这里有一个最小的工作示例:
import pyqtgraph as pg
pg.mkQApp()
pw = pg.PlotWidget()
p1 = pw.plotItem
p1.showAxis('right')
#import pdb; pdb.set_trace() # Running once with this line, once without
print p1.getAxis('right').rect().width()
运行:
# No breakpoint:
% python qtg_pdb_bug.py
0.0
# With breakpoint:
% python qtg_pdb_bug.py
> qtg_pdb_bug.py(7)<module>()
-> print p1.getAxis('right').rect().width()
(Pdb) c
35.0
问题:
- 出于好奇:在这将导致此怪事断点处停止时,会发生什么?这是pyqtgraph中的错误吗?
- 这是正确的/预期的结果? 0或35?
嗯,*我*获得退出分段错误。我认为这是对潜在问题的暗示。 – Veedrac
@Veedrac从我的经验来看,它是rt *不会在pyqtgraph退出时得到* segfault。不完全确定这是pyqtgraph的错误,但必须源自底层软件包。 – shx2
这听起来令人愉快:P。祝你好运。 – Veedrac