[Python-checkins] r86563 - peps/trunk/pep-0007.txt
georg.brandl
python-checkins at python.org
Sat Nov 20 15:08:26 CET 2010
Author: georg.brandl
Date: Sat Nov 20 15:08:26 2010
New Revision: 86563
Log:
Actually use 4-space indents in the PEP too.
Modified:
peps/trunk/pep-0007.txt
Modified: peps/trunk/pep-0007.txt
==============================================================================
--- peps/trunk/pep-0007.txt (original)
+++ peps/trunk/pep-0007.txt Sat Nov 20 15:08:26 2010
@@ -63,12 +63,12 @@
static int
extra_ivars(PyTypeObject *type, PyTypeObject *base)
{
- int t_size = PyType_BASICSIZE(type);
- int b_size = PyType_BASICSIZE(base);
+ int t_size = PyType_BASICSIZE(type);
+ int b_size = PyType_BASICSIZE(base);
- assert(t_size >= b_size); /* type smaller than base! */
- ...
- return 1;
+ assert(t_size >= b_size); /* type smaller than base! */
+ ...
+ return 1;
}
- Code structure: one space between keywords like 'if', 'for' and
@@ -76,10 +76,10 @@
shown:
if (mro != NULL) {
- ...
+ ...
}
else {
- ...
+ ...
}
- The return statement should *not* get redundant parentheses:
@@ -100,8 +100,8 @@
appropriately, e.g.:
PyErr_Format(PyExc_TypeError,
- "cannot create '%.100s' instances",
- type->tp_name);
+ "cannot create '%.100s' instances",
+ type->tp_name);
- When you break a long expression at a binary operator, the
operator goes at the end of the previous line, e.g.:
@@ -109,7 +109,7 @@
if (type->tp_dictoffset != 0 && base->tp_dictoffset == 0 &&
type->tp_dictoffset == b_size &&
(size_t)t_size == b_size + sizeof(PyObject *))
- return 0; /* "Forgive" adding a __dict__ only */
+ return 0; /* "Forgive" adding a __dict__ only */
- Put blank lines around functions, structure definitions, and
major sections inside functions.
More information about the Python-checkins
mailing list