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

在遵守 pep8 的基础上,如何使代码保持一定的风格?

  •  
  •   liuhao2050qq · 2016-10-14 17:24:07 +08:00 · 1913 次点击
    这是一个创建于 2743 天前的主题,其中的信息可能已经有所发展或是发生改变。
    如题,还有怎么样让自己的代码 让别人看起来也很 nice ?
    3 条回复    2016-10-19 16:21:55 +08:00
    tumbzzc
        1
    tumbzzc  
       2016-10-14 17:40:32 +08:00
    恰到好处的注释和变量命名
    Allianzcortex
        2
    Allianzcortex  
       2016-10-14 23:23:57 +08:00 via iPhone
    别用双下划线, single underscore 还不够嘛,一定要有 doc string
    GeekGao
        3
    GeekGao  
       2016-10-19 16:21:55 +08:00
    个人认为方法和函数命名太重要了
    感受下: human_change_the_name(name) vs human_name(name)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3645 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 04:21 · PVG 12:21 · LAX 21:21 · JFK 00:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.