diff --git a/about.html b/about.html index 9fab929..4f62e4d 100644 --- a/about.html +++ b/about.html @@ -2,11 +2,11 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/advanced-classes.html b/advanced-classes.html index a44fad4..215c345 100644 --- a/advanced-classes.html +++ b/advanced-classes.html @@ -3,11 +3,11 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/advanced-iterators.html b/advanced-iterators.html index 711a49c..216c4f0 100644 --- a/advanced-iterators.html +++ b/advanced-iterators.html @@ -2,11 +2,12 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/case-study-porting-chardet-to-python-3.html b/case-study-porting-chardet-to-python-3.html index 242690b..8725e9d 100644 --- a/case-study-porting-chardet-to-python-3.html +++ b/case-study-porting-chardet-to-python-3.html @@ -3,14 +3,14 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/generators.html b/generators.html index e8ad402..b1275d1 100644 --- a/generators.html +++ b/generators.html @@ -2,11 +2,12 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/index.html b/index.html index a0de802..b5eee76 100644 --- a/index.html +++ b/index.html @@ -3,14 +3,14 @@
chardet to Python 3
-2to3
-2to3
+There is a changelog, a feed, and discussion on Reddit. During development, you can download the book by cloning the Mercurial repository: diff --git a/iterators-and-generators.html b/iterators-and-generators.html index 93af6d2..8c1b710 100644 --- a/iterators-and-generators.html +++ b/iterators-and-generators.html @@ -3,12 +3,12 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/iterators.html b/iterators.html index dd52516..196e3c0 100644 --- a/iterators.html +++ b/iterators.html @@ -2,11 +2,12 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/native-datatypes.html b/native-datatypes.html index 87ba89f..acaac7a 100644 --- a/native-datatypes.html +++ b/native-datatypes.html @@ -2,11 +2,12 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/porting-code-to-python-3-with-2to3.html b/porting-code-to-python-3-with-2to3.html index ae0750c..a2cb1b7 100644 --- a/porting-code-to-python-3-with-2to3.html +++ b/porting-code-to-python-3-with-2to3.html @@ -2,7 +2,8 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/publish b/publish index 29e2904..7706020 100755 --- a/publish +++ b/publish @@ -34,7 +34,7 @@ sed -i -e "s|;}|}|g" build/m-$revision.css # put CSS inline css=`cat build/$revision.css` mobilecss=`cat build/m-$revision.css` -sed -i -e "s|||g" -e "s|||g" -e "s||g" -e "s|||g" -e "s| - +
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/regular-expressions.html b/regular-expressions.html index f6ab98e..c7f9f1b 100644 --- a/regular-expressions.html +++ b/regular-expressions.html @@ -2,11 +2,12 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/special-method-names.html b/special-method-names.html index 870e989..5297c81 100644 --- a/special-method-names.html +++ b/special-method-names.html @@ -3,7 +3,7 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/strings.html b/strings.html index 2ea3aa3..802148e 100644 --- a/strings.html +++ b/strings.html @@ -2,12 +2,12 @@
You are here: Home ‣ Dive Into Python 3 ‣ @@ -156,12 +156,12 @@ def approximate_size(size, a_kilobyte_is_1024_bytes=True): '1000KB = 1MB'
humansize module, you’re just grabbing one of the data structures it defines: the list of "SI" (powers-of-1000) suffixes.
+humansize module, you’re just grabbing one of the data structures it defines: the list of “SI” (powers-of-1000) suffixes.
{0} would refer to the first argument passed to the format() method, si_suffixes. But si_suffixes is a list. So {0[0]} refers to the first item of the list which is the first argument passed to the format() method: 'KB'. Meanwhile, {0[1]} refers to the second item of the same list: 'MB'. Everything outside the curly braces — including 1000, the equals sign, and the spaces — is untouched. The final result is the string '1000KB = 1MB'.
What this example shows is that format specifers can access items and properties of data structures using (almost) Python syntax. This is called compound field names. The following compound field names "just work": +
What this example shows is that format specifers can access items and properties of data structures using (almost) Python syntax. This is called compound field names. The following compound field names “just work”:
Python 3 assumes that your source code — i.e. each .py file — is encoded in UTF-8.
diff --git a/table-of-contents.html b/table-of-contents.html
index 18b3833..0eddd80 100644
--- a/table-of-contents.html
+++ b/table-of-contents.html
@@ -2,7 +2,7 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/unit-testing.html b/unit-testing.html index 47bcd0a..0629580 100644 --- a/unit-testing.html +++ b/unit-testing.html @@ -2,11 +2,12 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/whats-new.html b/whats-new.html index ad683c4..4ff6463 100644 --- a/whats-new.html +++ b/whats-new.html @@ -3,12 +3,12 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/xml.html b/xml.html index b54d291..cdd05d1 100644 --- a/xml.html +++ b/xml.html @@ -2,12 +2,13 @@
You are here: Home ‣ Dive Into Python 3 ‣ diff --git a/your-first-python-program.html b/your-first-python-program.html index f8513d5..1e9cc34 100644 --- a/your-first-python-program.html +++ b/your-first-python-program.html @@ -2,14 +2,15 @@
You are here: Home ‣ Dive Into Python 3 ‣