Introducing Python

Errata for Introducing 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
ePub
Page Loc 1182
Middle

letters[-1:0:-1] produces 'zyxwvutsrqponmlkjihgfedcb' not 'zyxwvutsrqponmlkjihgfedcba' To produce the latter string: letters[-1::-1]

Note from the Author or Editor:
Fixed this one and others in the slice section.

Richard Munde  Mar 07, 2014 
ePub
Page Loc. 502
Top of page

1.0e8 does not mean "one to the eighth power or 100000000.0" since 1 to the eighth power is one. Rather it mean 1 times 10 to the eighth power which indeed is 100000000.0.

Note from the Author or Editor:
Corrected. Thanks!

Richard Munde  Mar 07, 2014 
PDF
page 32: fifth and sixth paragraphs

letters[20:] is 'uvwxyz' not 'vwxyz' letters[12:15] is 'mno' not 'nop'

Note from the Author or Editor:
Fixed in Atlas.

Stephen Neuman  Mar 13, 2014 
PDF
Page 5
4d paragraph

The follwing code-snippet: import requests url = "https://gdata.youtube.com/feeds/api/standardfeeds/top_rated?alt=json" response = requests.get(url) data = response.json for video in data['feed']['entry'][0:6]: print(video['title']['$t']) Returns: Traceback (most recent call last): File "ex2.py", line 5, in <module> for video in data['feed']['entry'][0:6]: TypeError: 'method' object is not subscriptable I used python3.2 on Debian 7.4 to run the code which I previously saved in ex2.py, The module requests was installed.

Note from the Author or Editor:
Fixed. Lost the () in cut & paste.

Anonymous  Mar 06, 2014 
PDF
Page 32, 33
see below

letters[::7} is 'ahov' and not 'ahpq' letters[4:20:3] is 'ehknqt' and not 'ehloru' letters[19:4] is 'tx' and not 'uy' letters[:21:5] is 'afkpu' and not 'aflqv'

Note from the Author or Editor:
Those have been fixed in Atlas. I don't know when an update will be made available.

Anonymous  Mar 13, 2014 
ePub
Page 48/49

Test for a key with inIf you want to know whether a key exists in a dictionary, use in. Letís redefine the pythons dict again, omitting a name or two, chen checking to... Chen instead of then

Note from the Author or Editor:
Fixed. Thanks!

Scott Le Camp  Mar 11, 2014 
ePub
Page 130
Ch.8, "Write a text file with write", roughly page 130 of ePub.

"For some reason, there aren't many limericks about general relativity". There are none, as far as I know. This limerick refers to SPECIAL relativity. An esoteric point, I know, but, as a physicist, I couldn't let this one pass. And if you ever do find a limerick about general relativity, I'd love to hear it.

Note from the Author or Editor:
That is the best erratum I've ever seen. Thanks! Maybe I can find something about inflation or entanglement?

Martin Ward  Apr 06, 2014 
PDF
Page 131
Table 6-1

This table describes python's testing methods. In the table the last two methods appear to be incorrect. In the document: __lt__(self, other) self <=other __le__(self, other) self >=other It should read: __le__(self, other) self <=other __ge__(self, other) self >=other

Note from the Author or Editor:
Thanks for catching this.

Jerald Jackson  Apr 01, 2014 
PDF
Page 153
top

The Pattern Matches table at the top of page 153 shows the following: prev+? one or more prev, as few as possible prev+? one or more prev, as many as possible The table actually starts on the previous page (152) where both of the above possibilities are noted. Not to mention that the second is incorrect, I believe. It should read "prev+ one or more prev, as many as possible".

Note from the Author or Editor:
You're right, I had duplicated those two lines. Thanks.

Jerald Jackson  Apr 01, 2014 
PDF
Page 153
end of page

The second example from the bottom of the page reads: Find fish tonight. at the end: >>> re.findall('fish tonight.$', source) I could be mistaken as I am just learning python, but I think that perhaps should read: >>> re.findall('fish tonight\.$', source) Since the '.' would be interpreted as a regex character and not as a literal period.

Note from the Author or Editor:
Both work: >>> re.findall('fish tonight.$', source) ['fish tonight.'] The dot is interpreted as any character (including a period). For a literal period, I should say this: >>> re.findall('fish tonight\.$', source) ['fish tonight.']

Jerald Jackson  Apr 01, 2014 
ePub
Page 222
Roughly 1 page after section title "RPCs"; then end of OpenStack section.

Section on RPCs, ePub page 222. "The function we'll providing on the server..." should be "The function we'll be providing on the server..." Just after OpenStack section, page 229. "Things to to" should be "Things to do".

Note from the Author or Editor:
Fixed both of them. Thanks.

Martin Ward  Apr 06, 2014