[Edu-sig] Slightly OT: O'Reilly article

Jason Cunliffe Jason Cunliffe" <jasonic@nomadics.org
Fri, 18 Oct 2002 17:13:07 -0400


> Everybody, please review that page -- are there any missing resources?
> Beginners books that I should list?

I think Wesley Chun's "Core Python Programming" is a good 'beginner' book.
Slow enough to drive some of you crazy ;^)
The author assumes little, but never talks down. He takes care to explain
everything, especially background ideas and jargon. The book build-up very
gently for the first half. Brief mini tutorials and/or exercise questions [with
code answers] at the end of each chapter. The copy I have is good for 1.6 and
anticipates 2.0

Two quickie random excerpts ...

Chapter 2: Getting Started
2.8 Lists and Tuples
    Lists and tuples can be thought of as generic "buckets" with which to hold
an arbitrary number of arbitrary Python objects. The items are ordered and
accessed via indexed offsets, similar to arrays, except that lists and tuples
can store different types of objects.
    The main difference between lists and tuples are: Lists are enclosed in  [ ]
and their elements and size can be changed, while tuples are enclosed in
parentheses ( ) and cannot be updated. Tuples can be thought of for now as
"read-only" lists. Subsets can be taken with the slice operator [] and [:] in
the same manner as strings.
<code examples follow.
<in-depth discussion about uses and differences of list and tuples comes later
on. >


Chapter 10: Errors and Exceptions
10.1 Exceptions
10.1.1 Errors
    Before we get into details about what exceptions are, let us review what
errors are. In the context of software, errors are either syntactical or logical
in nature. Syntax errors indicate errors with the construct of the software and
cannot be executed by the interpreter or compiled correctly. These errors must
be repaired before execution can occur.
    Once programs are semantically correct, the only errors which remain are
logical. Logical errors can be caused by lack of invalid input, or, in other
cases, by the logic's not being able to generate, calculate, or otherwise
produce the desired results based on the input. These errors are sometimes known
as domain and range errors, respectively.
    When errors are detected by Python, the interpreter indicates that it has
reached a point where continuing to execute the current flow is no longer
possible. This is where exceptions come in into the picture.

./Jason