推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
harlen
V2EX  ›  Python

pycharm debug 的时候如何避免打印对象 堆栈溢出了,可能是循环引用

  •  
  •   harlen · Aug 22, 2025 · 2029 views
  •   You need to sign in to view this topic
    This topic created in 331 days ago, the information mentioned may be changed or developed.

    如题,代码正常能跑的。但是 debug 模式 pycharm 会自动打印对象。然后就堆栈溢出了, 还看不到具体是什么调用导致的溢出,只有

    进程已结束,退出代码为 -1073741571 (0xC00000FD) 的退出码
    
    4 replies    2025-08-22 15:03:41 +08:00
    kneo
        1
    kneo  
       Aug 22, 2025 via Android
    没听说会自动打印。是你自己代码里打印的吧。
    lthon
        2
    lthon  
       Aug 22, 2025
    用 pdb/ipdb 可解
    lthon
        3
    lthon  
       Aug 22, 2025
    @kneo pycharm 调试会显示当前变量的值
    harlen
        4
    harlen  
    OP
       Aug 22, 2025
    找到了。调试控台 上的 ... 里面可以设置变量的加载。改成 按需 就不会主动加载。

    查看对象直接报错是因为。用了 @property 里面拿索引数据,没判断 None 就直接让调试器都崩溃了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1009 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 23:05 · PVG 07:05 · LAX 16:05 · JFK 19:05
    ♥ Do have faith in what you're doing.