V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2016-03-23 20:43:17 +08:00 · 2863 次点击
    这是一个创建于 2959 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    7 条回复    2016-03-24 11:59:27 +08:00
    Shadowalker
        1
    Shadowalker  
       2016-03-23 20:58:21 +08:00
    这样相当于是:
    sometime >= yesterday and sometime <= now
    alexapollo
        2
    alexapollo  
       2016-03-23 21:15:15 +08:00
    语法糖
    feiyuanqiu
        3
    feiyuanqiu  
       2016-03-23 21:21:08 +08:00 via iPhone
    a < b < c
    c 里面也可以这么写,当然结果跟所期望的不太一样就是了
    lxy
        4
    lxy  
       2016-03-23 21:36:49 +08:00
    写过 username is None is userid
    akagi
        5
    akagi  
       2016-03-23 21:39:25 +08:00
    相信我 C++中也可以 :)
    congeec
        6
    congeec  
       2016-03-23 22:22:35 +08:00
    is_active = Ture == False
    h272377502
        7
    h272377502  
       2016-03-24 11:59:27 +08:00
    长见识了。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1090 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 18:40 · PVG 02:40 · LAX 11:40 · JFK 14:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.