XML Processing with Python by Sean McGrath

Michael Haggerty mhagger at alum.mit.edu
Thu Aug 17 21:14:34 EDT 2000


Thomas Gagne <tgagne at ix.netcom.com> writes:

> Since I just started with Python a week ago the book has been very
> helpful.

I've been reading this book too, mostly to learn about the XML side of
things.  I have two complaints:

1. It's extremely verbose, almost to the point of gratuitous pagecount
   inflation.  The pace might possibly be useful for extreme novices
   but for me it has far too little content per page.

2. It has many, many typos in the sample code.  This, I imagine, would
   make it frustrating even for the extreme novice.

Here's an example, from the regexp section ("reference
7061")--supposedly a regular expression to match the two character
string "backslash followed by n", or in Python notation "\\n":

>>> import re
>>> BackslashN = re.compile("\\n")
>>> print BackslashN.match("\\n")
None
>>> 

In other words, it doesn't match.  To match this string, you really
need

>>> BackslashN = re.compile("\\\\n")
>>> print BackslashN.match('\\n')
<re.MatchObject instance at 80ebf58>
>>> 

All in all I can't recommend this book.

Michael

-- 
Michael Haggerty
mhagger at alum.mit.edu



More information about the Python-list mailing list