Braces example for multiline conditionals (#284)

* Braces example for multiline conditionals.

Closes #283
This commit is contained in:
Barry Warsaw 2017-06-09 20:45:57 -07:00 committed by GitHub
parent 22e36e2113
commit 3800904843
1 changed files with 5 additions and 3 deletions

View File

@ -2,7 +2,7 @@ PEP: 7
Title: Style Guide for C Code
Version: $Revision$
Last-Modified: $Date$
Author: Guido van Rossum <guido@python.org>
Author: Guido van Rossum <guido@python.org>, Barry Warsaw <barry@python.org>
Status: Active
Type: Process
Content-Type: text/x-rst
@ -124,11 +124,13 @@ Code lay-out
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.::
operator goes at the end of the previous line, and braces should be
formatted as shown. E.g.::
if (type->tp_dictoffset != 0 && base->tp_dictoffset == 0 &&
type->tp_dictoffset == b_size &&
(size_t)t_size == b_size + sizeof(PyObject *)) {
(size_t)t_size == b_size + sizeof(PyObject *))
{
return 0; /* "Forgive" adding a __dict__ only */
}