comparison doc/v2_planning/API_coding_style.txt @ 1179:67f4edabb0cc

Merged
author Olivier Delalleau <delallea@iro>
date Fri, 17 Sep 2010 16:23:51 -0400
parents 10bc5ebb5823 fe6c25eb1e37
children 9ebd40d31a1b
comparison
equal deleted inserted replaced
1178:10bc5ebb5823 1179:67f4edabb0cc
28 ~~~~~~~~~~~~~~~ 28 ~~~~~~~~~~~~~~~
29 29
30 The four main documents describing our Python coding guidelines are: 30 The four main documents describing our Python coding guidelines are:
31 * `PEP 8 -- Style Guide for Python Code 31 * `PEP 8 -- Style Guide for Python Code
32 <http://www.python.org/dev/peps/pep-0008>`_ 32 <http://www.python.org/dev/peps/pep-0008>`_
33 * `Google Python Style Guide
34 <http://google-styleguide.googlecode.com/svn/trunk/pyguide.html>`_
33 * `PEP 257 -- Docstring Conventions 35 * `PEP 257 -- Docstring Conventions
34 <http://www.python.org/dev/peps/pep-0257>`_ 36 <http://www.python.org/dev/peps/pep-0257>`_
35 * `Numpy Docstring Standard 37 * `Numpy Docstring Standard
36 <http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines#docstring-standard>`_ 38 <http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines#docstring-standard>`_
37 * `Google Python Style Guide
38 <http://google-styleguide.googlecode.com/svn/trunk/pyguide.html>`_
39 39
40 40
41 However, there are a few points mentioned in those documents that we decided 41 However, there are a few points mentioned in those documents that we decided
42 to do differently: 42 to do differently:
43 43
47 a multi-line docstring. 47 a multi-line docstring.
48 48
49 .. code-block:: python 49 .. code-block:: python
50 50
51 # Good. 51 # Good.
52 """This is a multi-line docstring. 52 """
53 This is a multi-line docstring.
53 54
54 Which means it has more than one line. 55 Which means it has more than one line.
55 """ 56 """
56 57
57 # Bad. 58 # Bad.
306 307
307 # Good. 308 # Good.
308 if (cond_1 and 309 if (cond_1 and
309 cond_2 and 310 cond_2 and
310 cond_3): 311 cond_3):
312
311 ... 313 ...
312 # Bad. 314 # Bad.
313 if cond_1 and \ 315 if cond_1 and \
314 cond_2 and \ 316 cond_2 and \
315 cond_3: 317 cond_3: