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

Python 里 super(Chicken, self) super(Chicken, cls) 区别

  •  
  •   buhuipao · Aug 15, 2017 · 3097 views
    This topic created in 3327 days ago, the information mentioned may be changed or developed.

    如题 Python 里 super(Chicken, self) super(Chicken, cls) 的区别,

    2 replies  •  2017-08-15 10:17:07 +08:00
    gimp
        1
    gimp  
       Aug 15, 2017
    这个看你传递的是什么

    可能这篇文章能帮到你,Super 返回的是 mro 列表中的下一个类

    https://blog.yasking.org/a/python-super.html
    buhuipao
        2
    buhuipao  
    OP
       Aug 15, 2017
    @gimp 首先谢谢!类和实例的 mro 都一样的吗?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   858 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 20:59 · PVG 04:59 · LAX 13:59 · JFK 16:59
    ♥ Do have faith in what you're doing.