From b7ef6d1c7a25e0446decd8215cd1442b31887b5f Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Wed, 23 Sep 2009 09:00:35 -0400 Subject: [PATCH] missing asterisms. seriously. --- your-first-python-program.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/your-first-python-program.html b/your-first-python-program.html index a5030ae..f2f340c 100755 --- a/your-first-python-program.html +++ b/your-first-python-program.html @@ -304,6 +304,8 @@ except ImportError:

By the end of this try..except block, you have imported some module and named it etree. Since both modules implement a common API, the rest of your code doesn’t need to keep checking which module got imported. And since the module that did get imported is always called etree, the rest of your code doesn’t need to be littered with if statements to call differently-named modules. +

⁂ +

Unbound Variables

Take another look at this line of code from the approximate_size() function: @@ -322,6 +324,8 @@ NameError: name 'x' is not defined

You will thank Python for this one day. +

⁂ +

Everything is Case-Sensitive

All names in Python are case-sensitive: variable names, function names, class names, module names, exception names. If you can get it, set it, call it, construct it, import it, or raise it, it’s case-sensitive.