推荐学习书目
› 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
KyL
V2EX  ›  Python

Python Class 中的__del__和__exit__有什么区别?

  •  
  •   KyL · Feb 20, 2015 · 7671 views
    This topic created in 4260 days ago, the information mentioned may be changed or developed.
    5 replies  •  2015-02-21 07:42:47 +08:00
    Wicked
        1
    Wicked  
       Feb 20, 2015 via iPhone
    问google
    ryd994
        2
    ryd994  
       Feb 20, 2015
    RTFM
    neoblackcap
        3
    neoblackcap  
       Feb 20, 2015
    一个是你在delete对象时候调用的,一个是with语法,退出上下文的时候调用的,真的建议去读官方文档。
    ruoyu0088
        4
    ruoyu0088  
       Feb 20, 2015
    就是英语delete 和 exit 的区别。
    lcj2class
        5
    lcj2class  
       Feb 21, 2015 via Android
    这种问题为什么要在V2上出现,Google一下不比什么来的实在
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3939 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 04:13 · PVG 12:13 · LAX 21:13 · JFK 00:13
    ♥ Do have faith in what you're doing.