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

原来 python 里这样写也行: yesterday <= sometime <= now

  •  
  •   JhOOOn · Mar 23, 2016 · 3838 views
    This topic created in 3844 days ago, the information mentioned may be changed or developed.

    我记得原来学 C 的时候,这样写是不行的。 偶然看到一篇教程,里面是这样写返回值的,才知道,这样写也行啊。

    7 replies  •  2016-03-24 11:59:27 +08:00
    Shadowalker
        1
    Shadowalker  
       Mar 23, 2016
    这样相当于是:
    sometime >= yesterday and sometime <= now
    alexapollo
        2
    alexapollo  
       Mar 23, 2016
    语法糖
    feiyuanqiu
        3
    feiyuanqiu  
       Mar 23, 2016 via iPhone
    a < b < c
    c 里面也可以这么写,当然结果跟所期望的不太一样就是了
    lxy
        4
    lxy  
       Mar 23, 2016
    写过 username is None is userid
    akagi
        5
    akagi  
       Mar 23, 2016
    相信我 C++中也可以 :)
    congeec
        6
    congeec  
       Mar 23, 2016
    is_active = Ture == False
    casatAway
        7
    casatAway  
       Mar 24, 2016
    长见识了。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2357 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 08:06 · PVG 16:06 · LAX 01:06 · JFK 04:06
    ♥ Do have faith in what you're doing.