Mercurial > pylearn
comparison doc/v2_planning/API_coding_style.txt @ 1173:a0f178bc9052
changes during the meeting
author | pascanur |
---|---|
date | Fri, 17 Sep 2010 16:12:33 -0400 |
parents | d7192e52653e |
children | fe6c25eb1e37 |
comparison
equal
deleted
inserted
replaced
1172:3c2d7c5f0cf7 | 1173:a0f178bc9052 |
---|---|
24 ~~~~~~~~~~~~~~~ | 24 ~~~~~~~~~~~~~~~ |
25 | 25 |
26 The four main documents describing our Python coding guidelines are: | 26 The four main documents describing our Python coding guidelines are: |
27 * `PEP 8 -- Style Guide for Python Code | 27 * `PEP 8 -- Style Guide for Python Code |
28 <http://www.python.org/dev/peps/pep-0008>`_ | 28 <http://www.python.org/dev/peps/pep-0008>`_ |
29 * `Google Python Style Guide | |
30 <http://google-styleguide.googlecode.com/svn/trunk/pyguide.html>`_ | |
29 * `PEP 257 -- Docstring Conventions | 31 * `PEP 257 -- Docstring Conventions |
30 <http://www.python.org/dev/peps/pep-0257>`_ | 32 <http://www.python.org/dev/peps/pep-0257>`_ |
31 * `Numpy Docstring Standard | 33 * `Numpy Docstring Standard |
32 <http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines#docstring-standard>`_ | 34 <http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines#docstring-standard>`_ |
33 * `Google Python Style Guide | |
34 <http://google-styleguide.googlecode.com/svn/trunk/pyguide.html>`_ | |
35 | 35 |
36 | 36 |
37 However, there are a few points mentioned in those documents that we decided | 37 However, there are a few points mentioned in those documents that we decided |
38 to do differently: | 38 to do differently: |
39 | 39 |
43 a multi-line docstring. | 43 a multi-line docstring. |
44 | 44 |
45 .. code-block:: python | 45 .. code-block:: python |
46 | 46 |
47 # Good. | 47 # Good. |
48 """This is a multi-line docstring. | 48 """ |
49 This is a multi-line docstring. | |
49 | 50 |
50 Which means it has more than one line. | 51 Which means it has more than one line. |
51 """ | 52 """ |
52 | 53 |
53 # Bad. | 54 # Bad. |
146 | 147 |
147 # Good. | 148 # Good. |
148 if (cond_1 and | 149 if (cond_1 and |
149 cond_2 and | 150 cond_2 and |
150 cond_3): | 151 cond_3): |
152 | |
151 ... | 153 ... |
152 # Bad. | 154 # Bad. |
153 if cond_1 and \ | 155 if cond_1 and \ |
154 cond_2 and \ | 156 cond_2 and \ |
155 cond_3: | 157 cond_3: |