Huabaozi A person who likes talking so much

Book review on Python Distilled

Python Distilled is written by David M. Beazley in 2021. Here's the Amazon link to this book: https://www.amazon.com/Python-Essential-Reference-Developers-Library/dp/0134173279

As an engineer who regularly will use Python for daily job, I was looking for a book which could help me move from a Python beginner to intermediate Python developer. Such topics includes but not limited to the following:

  • how to understand Objects deeply
  • what are the meanings of different arguments types
  • how to do error handling, what is Decorator
  • what is Generator
  • what is lambda Expression
  • how to better under Modules and Packages
  • how to do complex Input and Output

Yes, many of those topics have been addressed by some excellent YouTube videos such as Corey Schafer, but they are not systematically, at least for myself. So I did a lot of Googling as well as reading Amazon reviews to find the book could satisfy my needs. According to my investigation, those candidates are:

Some of those authors are very good, they provided free e-books. Some of them have the contents for what I need, but they are very thick such as Python Cookbook and Fluent Python. What I need is a book which can also cover all those important topics while not too length so I could finish it :) After some extensive researches, I finally landed my eyes on this book Python Distilled. For me, it covers all the important topics I need while keep its lenthy not too scary.

And this book didn’t disappoint me. It does cover all the topics I really concern. And indeed as its name, this book controls its ilustration as dry as possible, but still have good examples so the readers can understand those concepts. For example, here’s the explanation for First-Class Objects:

All objects in Python are said to be first-class. This means that all objects that can be assigned to a name can also be treated as data. As data, objects can be stored as variables, passed as arguments, returned from fuctions, compared against other objects, and more.

Then the author gave a short but good example:

// For example, here is a simple dictionary containing two values:

items = {
    'number' : 42
    'text' : "Hello World"
}

// The first-class nature of objects can be seen by adding some more unusual items to this dictionary:
items['func'] = abs
import math
items['mod'] = math

Another thing I like this book is that in the last chapter Chapter 10, it provides all the Python Build-in Functions, all built-in Exceptions and all Python Standard Libraries so far. This can be used as dictionary or reference and gives the readers who are new to Python a general picture of all the tools we can use. After getting more familiar with those fundamental tools, new Python users will easier to move to the other tools as well.

Some errors

This is a great book, but I also found some errors from it.

In page 250, Section 9.3, the author gave the following example:

format(x, ‘<10.2f>’) # ‘123.46***’

The correct form should be:

format(x, ‘*<10.2f>’)

Example content

Howdy! This is an example blog post that shows several types of HTML content supported in this theme.

Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Sed posuere consectetur est at lobortis. Cras mattis consectetur purus sit amet fermentum.

Curabitur blandit tempus porttitor. Nullam quis risus eget urna mollis ornare vel eu leo. Nullam id dolor id nibh ultricies vehicula ut id elit.

Etiam porta sem malesuada magna mollis euismod. Cras mattis consectetur purus sit amet fermentum. Aenean lacinia bibendum nulla sed consectetur.

Inline HTML elements

HTML defines a long list of available inline tags, a complete list of which can be found on the Mozilla Developer Network.

  • To bold text, use <strong>.
  • To italicize text, use <em>.
  • Abbreviations, like HTML should use <abbr>, with an optional title attribute for the full phrase.
  • Citations, like — Mark otto, should use <cite>.
  • Deleted text should use <del> and inserted text should use <ins>.
  • Superscript text uses <sup> and subscript text uses <sub>.

Most of these elements are styled by browsers with few modifications on our part.

Heading

Vivamus sagittis lacus vel augue rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

Code

Cum sociis natoque penatibus et magnis dis code element montes, nascetur ridiculus mus.

// Example can be run directly in your JavaScript console


// Create a function that takes two arguments and returns the sum of those arguments

var adder = new Function("a", "b", "return a + b");

// Call the function

adder(2, 6);
// > 8

Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa.

Lists

Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

  • Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
  • Donec id elit non mi porta gravida at eget metus.
  • Nulla vitae elit libero, a pharetra augue.

Donec ullamcorper nulla non metus auctor fringilla. Nulla vitae elit libero, a pharetra augue.

  1. Vestibulum id ligula porta felis euismod semper.
  2. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
  3. Maecenas sed diam eget risus varius blandit sit amet non magna.

Cras mattis consectetur purus sit amet fermentum. Sed posuere consectetur est at lobortis.

HyperText Markup Language (HTML)
The language used to describe and define the content of a Web page
Cascading Style Sheets (CSS)
Used to describe the appearance of Web content
JavaScript (JS)
The programming language used to build advanced Web sites and applications

Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nullam quis risus eget urna mollis ornare vel eu leo.

Tables

Aenean lacinia bibendum nulla sed consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Name Upvotes Downvotes
Totals 21 23
Alice 10 11
Bob 4 3
Charlie 7 9

Nullam id dolor id nibh ultricies vehicula ut id elit. Sed posuere consectetur est at lobortis. Nullam quis risus eget urna mollis ornare vel eu leo.


Want to see something else added? Open an issue.