Errata

Python in a Nutshell

Errata for Python in a Nutshell

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.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

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

Version Location Description Submitted by Date submitted
Printed Page 56
Second set of examples

Third example should be:

x[1:4] = [8,9] # x is now [1, 8, 9]

Anonymous  Oct 14, 2012 
Printed Page 56
Third set of examples

The third example should be:

del x[::2] # x is now [2, 4]

Anonymous  Oct 14, 2012 
Printed Page 90
in the third line of the first item of the second enumeration

In the book it reads: "the value of C.name is the result of calling..." Shouldn't it be "x.name" because we are looking up an attribute of an instance?

Michael Jung  Feb 02, 2012 
Printed, PDF Page 90
? beginning "When 'name' is found in C", third line

C.name should be x.name because type(v)._ _get_ _(v, x, C) depends on x, contrary to C.name

candide  May 17, 2012 
Printed Page 90
9th paragraph

Original: "3. Otherwise, ..... If a descriptor v is found, the overall result of the attribute lookup is, again, type(v).__get__(v, x, C);"

It would be clearer by saying " If a nonoverriding descriptor v is found, the overall result of the attribute lookup is, again, type(v).__get__(v, x, C);".

Yanbing Lu  Oct 16, 2012 
Printed, PDF Page 105
__cmp__ description

"__cmp__ should return -1 if x is less than y"

This is not exactly what The Python Language Reference says ; x.__cmp__(y) may return a negative number, not necessarily -1.

candide  May 17, 2012 
Printed Page 117
5th para and footnote

LEAFMOST is, I hope, a typo, not another advanced topic...:-)

John Wheater  Jul 22, 2015 
Printed, PDF Page 160
cmp description

"Returns 1 when x is greater than y."

The official documentation doesn't impose cmp(x,y) call to return 1 if x>y, any positive value would be ok [even if the returned values by the C implementation of the cmp builtin function belongs to -1, 0, 1, cf. the PyObject_Compare function]

candide  May 17, 2012 
Printed Page 686
In L

This supersedes my erratum posted earlier today.

What is needed is an index entry on this page to page 157, where leafmost is defined, and 117, where I thought it was a typo

John Wheater  Jul 22, 2015