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
wyntergreg
V2EX  ›  Python

如何机智的解释"there is only one way to do it"?

  •  
  •   wyntergreg · 2017-03-17 13:49:05 +08:00 · 1526 次点击
    这是一个创建于 2599 天前的主题,其中的信息可能已经有所发展或是发生改变。

    给测试部的同事培训 Python 基础,我把这句列在语言特点中了,讲到这里的时候脑子突然闪过字符串赋值单双引号,大脑瞬间尴尬后直接讲"任何事物都有打脸的一面,比如字符串赋值..."囧

    PythonAnswer
        1
    PythonAnswer  
       2017-03-17 14:09:00 +08:00 via Android
    字符串引号是可以活用的。

    one best way to do it, called pythonic way
    wyntergreg
        2
    wyntergreg  
    OP
       2017-03-17 14:17:40 +08:00
    @PythonAnswer 如何活法,明明是单双引号通用么, python3 默认字符串双引号会转为单引号
    不过嵌套用的时候则按照定义顺序来,是否就是活在这了...手动滑稽
    4ever911
        3
    4ever911  
       2017-03-17 14:48:01 +08:00
    never say never!
    msg7086
        4
    msg7086  
       2017-03-18 00:39:29 +08:00
    只有一种最好的做法。
    至于哪种是最好的做法,可以吵几年。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3148 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 12:51 · PVG 20:51 · LAX 05:51 · JFK 08:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.