Python 编码标准/最佳实践

标签 python coding-style

在python中你一般使用PEP 8 -- Style Guide for Python Code作为您的编码标准/指南?您还有其他喜欢的正式标准吗?

最佳答案

"In python do you generally use PEP 8 -- Style Guide for Python Code as your coding standards/guidelines? Are there any other formalized standards that you prefer?"

正如您所说,请关注 PEP 8正文,PEP 257用于文档字符串约定

除了 Python 样式指南,我建议您引用以下内容:

  1. Code Like a Pythonista: Idiomatic Python
  2. Common mistakes and Warts
  3. How not to write Python code
  4. Python gotcha

关于Python 编码标准/最佳实践,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/356161/

相关文章:

python - 如何用空格填写 Python 字符串?

java - 如何强制初始化一个类?

c++ - 标题和模板类中的 namespace 包含

python - django.db.utils.ProgrammingError : syntax error at or near "WITH ORDINALITY" LINE 6:

python - 从文本文件python中提取一行

c# - 如何在不更改 COM 类 ID 的情况下向类添加方法

Intellij Idea/Android Studio 中的 Android 代码风格

ruby-on-rails - 有没有可以执行Ruby代码约定的gem?

python - 连接 Python 中 re.findall 找到的字符串

python - 使用 Python 创建一个 "uncrackable" "random"数字