build fiddling

This commit is contained in:
Mark Pilgrim
2009-06-09 13:07:05 -04:00
parent c6cb3c5db0
commit 8357efb7ad
3 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -134,7 +134,7 @@ SyntaxError: non-keyword arg after keyword arg</samp></pre>
<p class=a>&#x2042;
<h2 id=readability>Writing Readable Code</h2>
<p>I won&#8217;t bore you with a long finger-wagging speech about the importance of documenting your code. Just know that code is written once but read many times, and the most important audience for your code is yourself, six months after writing it (i.e. after you&#8217;ve forgotten everything but need to fix something). Python makes it easy to write readable code, so take advantage of it. You&#8217;ll thank me in six months.
<p>I won&#8217;t bore you with a long finger-wagging speech about the importance of documenting your code. Just know that code is written once but read many times, and the most important audience for your code is yourself, six months after writing it (<i>i.e.</i> after you&#8217;ve forgotten everything but need to fix something). Python makes it easy to write readable code, so take advantage of it. You&#8217;ll thank me in six months.
<h3 id=docstrings>Documentation Strings</h3>
<p>You can document a Python function by giving it a documentation string (<code>docstring</code> for short). In this program, the <code>approximate_size()</code> function has a <code>docstring</code>:
<pre><code class=pp>def approximate_size(size, a_kilobyte_is_1024_bytes=True):