Errata

Python for DevOps

Errata for Python for DevOps

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
14
Under "Machine Learning Key Terminology"

What I see : Supersized machine learning

What it should be : Supervised machine learning

Note from the Author or Editor:
on pg 389 of the book

Swaroop  Mar 05, 2020  Jun 19, 2020
Printed
Page 28
1st paragraph

The text says

"You can use comma-separated individual characters in a character set or use ranges."

Commas are not necessary in a range. If a comma is specified in a character range, the comma becomes part of the range itself.

>>> re.search('[R,B]obb[yi]', 'Robbi')
<re.Match object; span=(0, 5), match='Robbi'>

In the above example, the first character set contains "R", "," and "B", so "Robbi" matches.


>>> re.search('[R,B]obb[yi]', ',obbi')
<re.Match object; span=(0, 5), match=',obbi'>

Again, the first character set contains "R", "," and "B", so ",obbi" matches, which is definitely not what you want.


>>> re.search('[R,B]obb[yi]', 'Robb,')

In all three examples, the "[yi]" contains only two characters, "y" and "i". Here we try to match "Robb," but because "," does not match "y" or "i", it doesn't match.

Note from the Author or Editor:
>>> re.search('[R,B]obb[yi]', ',obbi')
<re.Match object; span=(0, 5), match=',obbi'>

Should be replaced with:

>>> re.search('[RB]obb[yi]', ',obbi')
<re.Match object; span=(0, 5), match=',obbi'>

Andy Lester  Mar 14, 2020  Jun 19, 2020
Printed
Page 44
In [1]

Example of log file format page 44 last 3rd of the page reads as:

127.0.0.1 - swills [13/Nov/2019:14:34:30 -0000] "GET /assets/234 HTTP/1.0" 200 2326

Later code example on page 45, In [64] parses for date in the above format, however, In [1] reads as:
In[1]: line = '127.0.0.1 - rj [13/Nov/2019:14:34:30] "GET HTTP/1.0" 200'

line should read as:
In[1]: line = '127.0.0.1 - rj [13/Nov/2019:14:34:30 -0000] "GET HTTP/1.0" 200'

Anonymous  Feb 09, 2020  Jun 19, 2020
Printed
Page 71
Example 3-5. click_example.py

Docstring for click example reads as:
"""
Command-line tool using argparse
"""

Docstring for click example should read as:
"""
Command-line tool using click
"""

Note from the Author or Editor:
"Command-line tool using argparse"
should be replaced with:
"Command-line tool using click"

Anonymous  Feb 09, 2020  Jun 19, 2020
Printed
Page 77
Middle

Code block referencing the "./fire_exampley.py ships sail" starts with the bash prompt $ as such.
$ ./fire_exampley.py ships sail

Later example in that block also include the full bash prompt
chapter3$ ./fire_example.py ships list.

It is clearly an editing error for the code, but make it appear, unedited.

Note from the Author or Editor:
The 'chapter3$' which appears twice in the example should be replaced with '$'

John MacTaish  Feb 12, 2020  Jun 19, 2020
Printed
Page 80
Paragraphs following topic heading, Using the Mumba Juist-in-time (Jit) Compiler

As another user has noticed:

Code examples discuss a program named nuclearcli.py that takes click arguments and performs array functions.

This code is never introduced, only referenced from pg 80 through the end of the chapter, in snippets, referencing the click functions.

In addition an array is used to demonstrate some examples but that array is never introduced, but is only referenced as rea = real_estate_array()

This leads to an extremely confusing introduction to the topic, almost as if several paragraphs and a code block, were left out, right before the words, "First, use a timing decoration to get a grasp on the runtime of your functions."

I found the complete code listing on Noah Gift's web site: https://github.com/noahgift/nuclear_powered_command_line_tools/blob/master/nuclearcli.py

Note from the Author or Editor:
Yes, we should swap up the code sample for this updated version: https://github.com/noahgift/nuclear_powered_command_line_tools/blob/master/nuclearcli.py

Anonymous  Apr 07, 2020  Jun 19, 2020
ePub
Page 282
last block of code snippen at beginning of the page

Logging - Deeper configuration

Code snipet says

file_logger.setLevel(logging.INFO)
console_logger.setFormatter(logging.Formatter(BASE_FORMAT))
root_logger.addHandler(file_logger)

Must be\:

file_logger.setLevel(logging.INFO)
file_logger.setFormatter(logging.Formatter(BASE_FORMAT))
root_logger.addHandler(file_logger)

Anonymous  May 16, 2020  Jun 19, 2020