推荐学习书目
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 · 5176 views
    This topic created in 4036 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
        1
    pyKun  
       Apr 25, 2015
    False is False is False 这个竟然是 True =,=
    c
        2
    c  
       Apr 25, 2015
    False is False is False -> True 求科普
    dofine
        3
    dofine  
       Apr 25, 2015   ❤️ 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
        4
    eeeeeeve  
       Apr 25, 2015
    视频链接在哪里?
    bcxx
        5
    bcxx  
       Apr 25, 2015   ❤️ 1
    @c
    @pyKun

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

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



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