Errata

Learning Python

Errata for Learning Python

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page 110
8th bullet point

Comparison operators may be chained: X < Y < Z

Text says: "produces the same result as X < Y and Y < X"

Should be: "produces the same result as X < Y and Y < Z"

Unless I misunderstood the meaning.

Note from the Author or Editor:
Yes, a valid typo, but this was a known issue that was fixed 6 years ago when we did the 4th Ed of the book (and is correct in the current 5th Ed). We're not doing reprints of the 3rd Ed anymore, but confirming this for readers of older books and ebooks, and in case an ebook update becomes warranted.

Joseph Santoyo  Jun 14, 2015 
Printed, PDF, , Other Digital Version
Page 840
3rd paragraph

"I ran this in a shell widow with Python 3.0. "

I think you mean "window" in "widow."

Note from the Author or Editor:
[This is actually a 4th Edition typo, but went unfixed till now because it was filed against the 3rd Edition.]

Yes -- please fix as described: "widow" should be "window". This appears on Page 842 in the latest printing I've seen (Nov 2011), at the start of paragraph 4.

David Phillips  Dec 08, 2011 
Printed, PDF, , Other Digital Version
Page 744
line 4 of "Why you will care..."

"picking" should be "pickling".

Note from the Author or Editor:
Yes -- change "by picking or shelving" to "by pickling or shelving", at the end of line 4 of the sidebar that is now on Page 748 in the May 2011 reprint.

(Type changed: this is hardly a serious technical mistake!)

Mike Sweeney  May 30, 2011 
PDF
Page 704
answer 3.

"A class must manually call the __init__ method in a superclass if it defines an
__init__ constructor of its own"

Am I right in guessing you mean that the subclass constructor does not automatically call its superclass constructor(s)?

I'm guessing many readers would finish the sentence believing that an exception will be thrown if they forget to code a superconstructor call.

Note from the Author or Editor:
No, the second half of this sentence (left out of this post):

"but it also must still kick off the superclass?s construction code."

means you need to make the call only if you need the superclass's constructor code to be run too. This is also well documented earlier in the Chapter itself -- see especially section "Calling Superclass Constructors" where this is made very clear-- and the exercises are just a review of this material.

Still, the language here is a bit loose, and reflects some editing made during production. To clarify, let's change the first sentence of answer #3 now on Page 708 to read as follows:

"3. A class must manually call the __init__ method in a superclass if it defines an __init__ constructor of its own and still wants the superclass?s construction code to run."

(I'll repost this to the 4th Ed's list, since this is really about that).

Mike Sweeney  May 23, 2011 
Printed
Page 305
Code sample in middle of page

Comment in the code fragment was:

# 2.6: print >> sys.stderr,'Bad' * 8

It should be:

# 2.6: print >> sys.stderr,'Bad!' * 8

Note from the Author or Editor:
Yes - a minor thing, but the comment reuqires the "!" to make it fully equivalent.

Tom Ekberg  Apr 14, 2010 
Printed
Page 566
2nd exercise, 1st line

"Write a class called Mylist..."

According to the name convention, Mylist should be MyList. The answer to this question (p664-665) also use MyList.

Note from the Author or Editor:
I posted a fix for this in the errata list for the 4th Edition, page 817 (the same names are used in that edition). In short, yes: in questions #2 and #3, "Mylist" and "MylistSub" should be changed to "MyList" and "MyListSub" so that they match the names used in the solutions to these exercises in Appendix B. Not a major issue, but worth a fix.

Weakish Jiang  Dec 13, 2009 
Printed
Page 31
4th paragraph

The Vaults of Parnassus web site http://www.vex.net/parnassus/ does not exist as far as I can tell. I see all kinds of writing about it on a Google search and the address on page 31 which I have reiterated above doesn't get me anywhere but shows a plethora of sites which use the words vaults of parnassus in links but when I click on them I get some CIA style message: Forbidden
You don't have permission to access /parnassus/ on this server.

I was at this for over an hour and found no such site as that on page 31 - http://www.vex.net/parnassus/.

Note from the Author or Editor:
The Vaults of Parnassus, mentioned on page 31 of the 3rd and prior Edition of this book, is no more. It is an ex-website; it has ceased to be; (insert the rest of the Dead Parrot sketch here...). We removed it from the new edition of the book, but it was still valid when the prior edition came online. Today, use PyPI or search Google for extensions.

Dave Rose  Nov 09, 2009 
Printed
Page N/A
N/A

Note from the author:

I keep a separate errata list, which may or may
not intersect with the list kept here over time.
Please see the following web page for my errata
and updates lists:

http://www.rmi.net/~lutz/lp3e-updates.html<p>

Given that there is a newer edition of this book,
chances are good that I will be maintaining errata
on my own list, instead of the redundant set here.

Thanks,
--Mark Lutz

Mark Lutz
 
Oct 29, 2009 
Printed
Page 325
3rd example code block

The line "return acts" should be indented one level.

Note from the Author or Editor:
This is a known errata, and has been fixed in later
printings of the book.

Please see the following page, where I keep track of
book corrections, and post general notes about both
the book and recent changes in Python:

http://www.rmi.net/~lutz/lp3e-updates.html

Eric Knibbe  Jan 29, 2009 
Printed
Page 277
Answer #7

"A comfy couch" was never one of the weapons employed by the Spanish Inquisition?"a comfy chair" would be more accurate.

Note from the Author or Editor:
Yep -- I transposed furniture here somehow. I'm not sure this qualifies as a tecnical mistake (and it's not exactly going to make the Mars Rover run into a boulder or anything...), but it merits a patch in future printings.

Eric Knibbe  Jan 24, 2009 
PDF
Page 322
1st code sample

Code sample

>>>def maker(N):
... def action(X):
... return X ** N
...return action
...

does not compile, indentation on "return action" is wrong.

Note from the Author or Editor:
This is a known errata, and has been fixed in later
printings of the book.

Please see the following page, where I keep track of
book corrections, and post general notes about both
the book and recent changes in Python:

http://www.rmi.net/~lutz/lp3e-updates.html

Juan Manuel Tamayo  Jan 18, 2009 
Printed
Page 591
1st paragraph lines[-2]

It reads:
"Mixing from into the same statement ...."

but shoud be:
"Mixing finally into the same statement ...."

Note from the Author or Editor:
This is a known errata, and has been fixed in later
printings of the book.

Please see the following page, where I keep track of
book corrections, and post general notes about both
the book and recent changes in Python:

http://www.rmi.net/~lutz/lp3e-updates.html

Anonymous  Oct 05, 2008 
Printed
Page xxxvii
3rd bullet item, bad backquotes formatting

In the Python 3.0 changes section, this bullet item describes the demise of the
backquotes expression, but seems to show this using straight quotes.
Backquotes are formatted properly later, on pages 96 and 136.

Anonymous    Jul 01, 2008
Printed
Page xxxix
6th bullet item from page bottom, missing comma

Also in the Python 3.0 section, a comma in program code was deleted, also somewhere in the
production process. The "except name value" should read as "except name, value" as described
later in the book (see pages 583, 594, 612, and 614).

Anonymous    Jul 01, 2008
Printed
Page 5
on the first line

Python mplements
should be:
Python implements

Anonymous    Jul 01, 2008
Printed
Page 72
first code block

...error text omittted...
should be:
...error text omitted...

Anonymous    Jul 01, 2008
Printed
Page 132
Tip at top of page, 3rd line

No space between "of" and "small" in the line:

"...mutable sequence ofsmall integers..."

Anonymous    Jul 01, 2008
Printed
Page 175
2nd full code block, 2nd comment

# This works: can chage mutables inside
should be:
# This works: can change mutables inside

Anonymous    Jul 01, 2008
Printed
Page 226
first sentence on page,

In the very first sentence on this page, the "rwords" should be "words"

Anonymous    Jul 01, 2008
Printed
Page 233
sidebar "Why You Will Care: print and stdout", 3rd paragraph

...it doesn't care what SYS.SYTDOUT is, only...
should be:
...it doesn't care what SYS.STDOUT is, only...

Anonymous    Jul 01, 2008
Printed
Page 305
paragraph 4, sentence 2

Sentence 2 of paragraph 4 on this page incorrectly states that the * operator, and hence the times
function "will work on numbers (performing multiplication), two strings or a string and a number
(performing repetition), or any other combination of objects supporting the expected interface". This
is incorrect -- * works on two numbers, or a string and a number, but not on two strings. That is,
string * string is not a valid operation.

In fact, if you pass two strings into the times function, it generates an exception, the point of the
next paragraph in the book.

Anonymous    Jul 01, 2008
Printed
Page 456
in "Class Method Calls", transposed variable names

In 2 spots of this section, I transposed the I1/I2 and C2/C3 variable names. The typo should be
apparent from the surrounding text, but it could also be a bit confusing given the introductory
nature of this section. Specifically: in this section's very first sentence, "C2.w" should be "C3.w";
in the last sentence of this section's second paragraph, "C3.w(I1)" should be "C3.w(I2)."

Anonymous    Jul 01, 2008
Printed
Page 507
2nd line from bottom of page, typo in code comment

There is a case typo in the commented-out line here. It should read "#print C.m.X", with the
uppercase

Anonymous    Jul 01, 2008