Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Channels ▼


Book Review: Learning Python, Fourth Edition

Learning Python, Fourth Edition
Mark Lutz
O'Reilly Media, 2010
1,216 pp., $54.99
ISBN: 978-0-596-15806-4

I have been a Python programming fan for many years. I was introduced to the language during a time when I was quickly becoming enamored with the first release of Borland's Delphi. After boasting to another developer about how Delphi was vastly superior to the version of Microsoft's Visual Basic at that time, this insightful person suggested I take a look at this relatively new dynamic language named after the Monty Python comedy troupe.

I put his suggestion off for a few weeks while I continued whipping up GUI goodness in various Delphi apps I was writing. Then a server-side text processing need arose, offering the ideal opportunity to give this snake-mascot language a chance to show me what made it so special. At the time, there was no Google, so I obtained most of what I needed from newsgroups and the meager Python 1.x documentation available at that time. Still, I was impressed with the rapid development time, the clear (and forcefully formatted) syntax and overall concise engineering nature of the language. It wasn't until 1999 when I read the first edition of Mark Lutz's Learning Python that I understood the reasoning behind much of the language's intentions and design decisions. Indeed, after Learning Python, I felt as though I had truly taken the time to deeply learn the language rather than call upon bits and pieces as I my projects demanded. More recently, Mark Lutz has written the fourth edition of Learning Python, a tome that weighs in at more than 1,150 pages.

The world of programming has changed considerably since the dot-com heydays and, perhaps not remarkably, the man who created Python (Guido van Rossum) is now at Google, and this powerful search engine company uses van Rossum's talents and his language for a portion of its secret sauce. For a company with the engineering calibre and collective IQ points of Google to commit to Python has much to say about the efficacy of the language itself.

So here we are in 2010 and the Python language is at a crossroads between its legacy 2.6 and below, and its new 3.x and higher. I agree with the book's author that those who are shackled by complex legacy Python programs to stick with the coding conventions of the pre-3.0 days.

Greenfield projects should almost always consider the 3.x codebase, with the upcoming 3.1 release being the most promising. It is with these suggestions and caveats that the author reminds readers of the difference between the two classifications and why the book has increased in size to accommodate explaining the differences and reasons behind the language's evolutionary changes.

For the uninitiated, especially those new Django web developers who are ready to go beyond the browser, Learning Python is the bible of Python education. Reading this book while practicing the code at a terminal and taking the quizzes at the end of each chapter along the way will elevate your depth of knowledge and appreciation for this workhorse language. Even for a seasoned Python veteran like myself, the book took over two months to read cover to cover. While much of the material is replicated from earlier editions, there are enough insertions of new insights and syntax call-outs that made revisiting this book like seeing a favorite city that has continued to undergo explosive construction and expansion.

Five new chapters filling an additional 200+ pages touch on more advanced topics such as Unicode, managed attributes, decorators and metaclasses. Receiving this more comprehensive instruction helped me better obtain a crystal clear understanding of these constructs and the recommended approaches for their use. So even after 10+ years of reading Mark's evolutionary work, he still has precious nuggets of information worthy of the book's cover price. Naturally for those who are new to the language, all the basics are covered in great detail in the books eight parts: Getting Started, Types and Operations, Statements and Syntax, Functions, Modules, Classes and OOP, Exceptions and Tools and, the bulk of the new material, Advanced Topics. Two appendixes on Installation/Configuration and the solutions to the end-chapter quizzes round out this city phonebook-sized educational experience.

Overall, I give Learning Python my strong recommendation to anyone seeking the most detailed introduction to the language and who has the patience to commit to the multi-week effort of grok'ing the material the author has condensed into this culmination of his years of writing and teaching the subject. While other Python tutorial books do an adequate job of getting readers up to speed quickly, few can touch the depth and calm, steady progression of deeper understanding by example and comfortably clear explanations by an author who has devoted the last 10+ years of his life to the art of teaching Python to the world.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.