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

pid = user and user.id or False

  •  
  •   jacklong ·
    jack-long · Feb 4, 2015 · 3105 views
    This topic created in 4135 days ago, the information mentioned may be changed or developed.

    python中逻辑运算从左到右进行,and运算返回第一个假值,若都为真则返回最后一个真值。or运算返回第一个真值,若都为假则返回最后一个假值。

    ryd994
        1
    ryd994  
       Feb 5, 2015 via Android   ❤️ 1
    乖乖用括号……
    你这样除了给其他人考语法之外,没有任何意义
    jacklong
        2
    jacklong  
    OP
       Feb 5, 2015
    @ryd994 Readability counts.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5812 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 06:13 · PVG 14:13 · LAX 23:13 · JFK 02:13
    ♥ Do have faith in what you're doing.