diff --git a/advanced-iterators.html b/advanced-iterators.html new file mode 100644 index 0000000..5cb4f44 --- /dev/null +++ b/advanced-iterators.html @@ -0,0 +1,27 @@ + +
+ +You are here: Home ‣ Dive Into Python 3 ‣ +
++❝ FIXME ❞
— FIXME +
+
FIXME + +
© 2001–9 ℳark Pilgrim + + + diff --git a/index.html b/index.html index 2c62bb8..8d03f58 100644 --- a/index.html +++ b/index.html @@ -27,13 +27,13 @@ h1:before{content:""}
Let’s talk about plural nouns. Also, functions that return other functions, advanced regular expressions, iterators, and generators. But first, let’s talk about how to make plural nouns. (If you haven’t read the chapter on regular expressions, now would be a good time. This chapter assumes you understand the basics of regular expressions, and quickly descends into more advanced uses.) -
English is a schizophrenic language that borrows from a lot of other languages, and the rules for making singular nouns into plural nouns are varied and complex. There are rules, and then there are exceptions to those rules, and then there are exceptions to the exceptions. - +
English is a schizophrenic language that borrows words from many other languages. The most basic linguistic operations, like taking a singular noun and turning it into a plural noun, are complicated by the language's mixed heritage. There are rules, and then there are exceptions to those rules, and then there are exceptions to the exceptions. +
In this chapter, you’re going to learn about about plural nouns. Also, functions that return other functions, advanced regular expressions, iterators, and generators. But first, let’s talk about how to make plural nouns. (If you haven’t read the chapter on regular expressions, now would be a good time. This chapter assumes you understand the basics of regular expressions, and it quickly descends into more advanced uses.)
If you grew up in an English-speaking country or learned English in a formal school setting, you’re probably familiar with the basic rules:
Now let’s see how you can use this rules file. +
[FIXME: now that this chapter comes before the I/O chapter, need to at least mention what open() does]
import re
diff --git a/table-of-contents.html b/table-of-contents.html
index ac75705..58ad5c0 100644
--- a/table-of-contents.html
+++ b/table-of-contents.html
@@ -118,28 +118,28 @@ ul li ol{margin:0;padding:0 0 0 2.5em}
- Case study: parsing phone numbers
- Summary
-
- The power of introspection
+
- Iterators & generators
- - Diving in
-
- Using optional and named arguments
+
- Diving in
+
- I know, let’s use regular expressions!
+
- A list of functions
+
- A list of patterns
+
- A file of patterns
+
- Generators
- - Keyword-only arguments
+
- A Fibonacci generator
+
- A plural rule generator
- - Using type, str, dir, and other built-in functions
+
- Iterators
- - The type function
-
- The str function
-
- Built-in functions
+
- A Fibonacci iterator
+
- A plural rule iterator
- - Getting object references with getattr
-
- - getattr with modules
-
- getattr as a dispatcher
-
- - Filtering lists
-
- Using lambda functions
-
- Putting it all together
-
- Summary
+
- Further reading
+
+ - Advanced Iterators
+
- Objects and object-orientation
@@ -178,25 +178,6 @@ ul li ol{margin:0;padding:0 0 0 2.5em}
- Handling errors (exceptions)
- Writing to files
- - Iterators & generators
-
- HTML processing
- Diving in
diff --git a/unit-testing.html b/unit-testing.html
index 0523a81..efa43f1 100644
--- a/unit-testing.html
+++ b/unit-testing.html
@@ -4,7 +4,7 @@
Unit testing - Dive into Python 3
@@ -15,8 +15,7 @@ body{counter-reset:h1 7}
(Not) Diving In
-How do you know that the code you wrote yesterday still works after the changes you made today? Every seasoned programmer has war stories of an “innocent” change that couldn't possibly have affected that other “unrelated” module… If this sounds familiar, this chapter is for you.
-
In this chapter, you're going to write and debug a set of utility functions to convert to and from Roman numerals. You saw the mechanics of constructing and validating Roman numerals in “Case study: roman numerals”. Now step back and consider what it would take to expand that into a two-way utility.
+
In this chapter, you're going to write and debug a set of utility functions to convert to and from Roman numerals. You saw the mechanics of constructing and validating Roman numerals in “Case study: roman numerals”. Now step back and consider what it would take to expand that into a two-way utility.
The rules for Roman numerals lead to a number of interesting observations:
- There is only one correct way to represent a particular number as Roman numerals.