原文:https://github.com/zgia/manual
PEP 8 -- Style Guide for Python Code
PEP: | 8 |
---|---|
Title: | Style Guide for Python Code |
Version: | dc5a21b8bc47 |
Last-Modified: | 2012-03-15 08:24:13 +0100 (Thu, 15 Mar 2012) |
Author: | Guido van Rossum <guido at python.org>, Barry Warsaw <barry at python.org> |
Status: | Active |
Type: | Process |
Content-Type: | text/x-rst |
Created: | 05-Jul-2001 |
Post-History: | 05-Jul-2001 |
翻译: | zgia, albert |
Contents 内容
- Introduction 介绍
- A Foolish Consistency is the Hobgoblin of Little Minds 愚蠢的一致性就像没脑子的妖怪
- Code lay-out 代码布局
- Whitespace in Expressions and Statements 表达式和语句中的空格
- Comments 注释
- Version Bookkeeping 版本注记
- Naming Conventions 命名约定
- Programming Recommendations 程序设计建议
- References 引用
- Copyright 版权
Introduction 介绍
This document gives coding conventions for the Python code comprising the standard library in the main Python distribution. Please see the companion informational PEP describing style guidelines for the C code in the C implementation of Python [1].
本文档列出的编码约定,是基于主Python发行版标准库的Python代码的。Python的C语言实现的C代码风格指南,请参阅PEP 7[1]。
This document was adapted from Guido's original Python Style Guide essay [2], with some additions from Barry's style guide [3]. Where there's conflict, Guido's style rules for the purposes of this PEP. This PEP may still be incomplete (in fact, it may never be finished <wink>).
这篇文档改编自Guido(译者注:Python之父,Guido van Rossum)最初的《Python Style Guide》[2]一文,《Barry's style guide》