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

看 PyCon 2015 视频学习到的内容

  •  1
     
  •   ruoyu0088 · Apr 25, 2015 · 5737 views
    This topic created in 4218 days ago, the information mentioned may be changed or developed.
    下面的表达式的结果是:

    False is False is False

    下面哪个更快? +=还是extend()?:

    ba = bytearray()

    ba += ....
    ba.extend(...)

    使用super()和多继承可以改变父类的搜索顺序。
    Supplement 1  ·  Apr 25, 2015
    12 replies  •  2015-04-25 20:41:45 +08:00
    pyKun
    pyKun
    Apr 25, 2015
    1
    False is False is False 这个竟然是 True =,=
    c
    c
    Apr 25, 2015
    2
    False is False is False -> True 求科普
    dofine
    dofine
    Apr 25, 2015❤️3
    3
    @pyKun
    @c
    Chaining operators like a is b is c is equivalent to a is b and b is c. So the first example is False is False and False is False, which evaluates to True and True which evaluates to True Having parenthesis leads to the result of one evaluation being compared with the next variable (as you say you expect), so (a is b) is c compares the result of a is b with c.

    (http://stackoverflow.com/questions/28104393/why-does-false-is-false-is-false-evaluate-to-true)
    eeeeeeve
    eeeeeeve
    Apr 25, 2015
    4
    视频链接在哪里?
    bcxx
    bcxx
    Apr 25, 2015❤️1
    5
    @c
    @pyKun

    这个你按照 1 <= 1 <= 1 来了解
    ericls
    ericls
    Apr 25, 2015❤️1
    8
    @c Python 就是这点爽

    可以直接写 1 <= 2 == 2 <= 3
    eeeeeeve
    eeeeeeve
    Apr 25, 2015
    9
    @newghost 这些是ppt吧?
    reorx
    reorx
    Apr 25, 2015❤️2
    10
    今年印象最深的是 Guido 关于 Diversity 的那一场,全程满槽点,给大家看我和小伙伴讨论时的截屏



    laike9m
    laike9m
    Apr 25, 2015
    12
    说实话,我认为这种 inconsistent 的东西没必要太纠结,说不定下个版本或另一个 Python 实现里就是另一种更快。倒是 Raymond 的那个 beyond pep8 演讲非常好,推荐去看。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4128 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 09:16 · PVG 17:16 · LAX 01:16 · JFK 04:16
    ♥ Do have faith in what you're doing.