Python 教程说“在运算符周围和逗号后使用空格,但不要直接在括号结构内:a = f(1, 2) + g(3, 4)。” “不直接在括号结构内”到底是什么意思?
最佳答案
这可能来自 PEP 8 -- Style Guide for Python Code .具体请参阅“表达式和语句中的空格”部分。
从那个部分:
Avoid extraneous whitespace in the following situations:
- Immediately inside parentheses, brackets or braces.
Yes: spam(ham[1], {eggs: 2})
No: spam( ham[ 1 ], { eggs: 2 } )
关于python - Python编码风格中的空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9714161/