diff --git a/http-web-services.html b/http-web-services.html index f85c98f..86bf445 100644 --- a/http-web-services.html +++ b/http-web-services.html @@ -209,7 +209,7 @@ Cache-Control: max-age=31536000, public
To see why this is inefficient and rude, let’s turn on the debugging features of Python’s HTTP library and see what’s being sent “on the wire.” +
To see why this is inefficient and rude, let’s turn on the debugging features of Python’s HTTP library and see what’s being sent “on the wire” (i.e. over the network).
>>> from http.client import HTTPConnection
diff --git a/push b/push
index 7544c0f..c12ff92 100755
--- a/push
+++ b/push
@@ -1,4 +1,14 @@
#!/bin/sh
+die () {
+ echo "$1" >/dev/stderr
+ exit 1
+}
+
+hg status|grep "^\?" && die "Stray files found."
+echo "running unit tests"
+cd examples/
+python3 regression.py
+cd ..
ssh diveintomark.org "hg -R /home/mark/db/diveintopython3/ serve --stdio" &
hg push ssh://mark@diveintomark.org//home/mark/db/diveintopython3/
diff --git a/your-first-python-program.html b/your-first-python-program.html
index 7c18b6b..d9c3163 100644
--- a/your-first-python-program.html
+++ b/your-first-python-program.html
@@ -134,7 +134,7 @@ SyntaxError: non-keyword arg after keyword arg
⁂
I won’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’ve forgotten everything but need to fix something). Python makes it easy to write readable code, so take advantage of it. You’ll thank me in six months. +
I won’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’ve forgotten everything but need to fix something). Python makes it easy to write readable code, so take advantage of it. You’ll thank me in six months.
You can document a Python function by giving it a documentation string (docstring for short). In this program, the approximate_size() function has a docstring:
def approximate_size(size, a_kilobyte_is_1024_bytes=True):