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

大家写代码时“符号的前后”加空格的吗?比如是 a = 0 还是 a=0?

  •  
  •   zictos · 2020-04-21 11:29:57 +08:00 · 11803 次点击
    这是一个创建于 1438 天前的主题,其中的信息可能已经有所发展或是发生改变。

    感觉不加空格写代码的速度更快,如果是为阅读性考虑,可以在代码写好后通过 ide 格式化代码

    108 条回复    2020-04-22 20:52:50 +08:00
    1  2  
    ShundL
        101
    ShundL  
       2020-04-22 09:48:00 +08:00
    @ShundL #95 回复错了。。。
    ZehaiZhang
        102
    ZehaiZhang  
       2020-04-22 10:04:39 +08:00
    靠格式化规范
    lzihua
        103
    lzihua  
       2020-04-22 10:05:58 +08:00
    输入的时候 打空格
    fordoo
        104
    fordoo  
       2020-04-22 10:09:25 +08:00
    go 不存在这个问题
    biguokang
        105
    biguokang  
       2020-04-22 10:18:09 +08:00
    我喜欢 a= 0 或者 a =0
    xpresslink
        106
    xpresslink  
       2020-04-22 11:31:14 +08:00
    一直用 pycharm 提交前会习惯性地 Ctrl+A 然后 Ctrl+Atl+L ...
    craiiz
        107
    craiiz  
       2020-04-22 17:27:50 +08:00
    追求页面右上角一个绿色的“✔”
    JacobXia
        108
    JacobXia  
       2020-04-22 20:52:50 +08:00
    写完后通过 ide 的格式化容易改到别的代码,提交代码时容易造成冲突。我这带新人前期写代码时都是写好后直接按 `crtl+alr+l`去格式化代码,没有去手动选中自己写的那部分代码。这样在提交代码时容易影响到其他人的代码,在合并时会有一堆冲突
    1  2  
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2951 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 11:06 · PVG 19:06 · LAX 04:06 · JFK 07:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.