Python is a high-level, versatile programming language used in many fields, from web development up to machine learning, passing through image analysis and game programming. It is easy to fall in love with it. Having such a vibrant community, and being used in top projects such as Docker and Openstack, results in a lot of titles available to anyone interested in getting started with it. On the other hand, those Pythonists that already know the basics and wanna dive into the most advanced features of the language often strive to find a valid source of information. Professional Python belongs to this short list of books dedicated to advanced topics, those that any professional needs to know and that most alternatives do not touch at all.
Released in 2015, Professional Python is a medium sized book that, as the title suggests, covers advanced topics. As such, it targets intermediate to experienced Pythonists and avoids anything related to the basics: installation, classes, data types. The book is split into sections, each spanning several chapters. Each chapter focuses on a very specific subject, such as metaclasses, decorators or generators. After a short introduction, the author presents a scenario, used to show many different features or ways to tackle the problem. One paragraph, one feature. This is a winning approach. Instead of long sermons, the authors dives into a very specific topic, showing how that feature improves the initial scenario.
The topics discussed by the author are well chosen and appropriate for such an advanced title. The examples are short but intense. There is plenty of code, and while the author often goes through it step by step, the reader more often than not needs to give it a second read to fully understand what is going on. Having a terminal open and trying to tinker the code presented is probably the best way to get the most out of this book.
Overall Professional Python is a good book. There are better alternatives, but it's a good read. After reading the first chapter, dedicated to decorators, I was expecting something better. This first chapter was indeed very good and definitely raised the expectations. Unfortunately, later on, I felt the quality of the content lowered and, with it, my final evaluation of this title. Some concepts, indeed, are not clearly explained. For example, generators are presented as functions that instead of executing and returning a single value, send back one or more values in a sequence. I do not agree with this, since a generator function is a function that has at least a yield statement in its body and that returns a generator object.
So a good book, but I would definitely suggest another two titles to any Pythonist interested in advanced topics. These two titles cover more terrain and in a much clearer way:
* Fluent Python
* Effective Python: 59 Specific Ways to Write Better Python
As usual, you can find more reviews on my personal blog: books.lostinmalloc.com. Feel free to pass by and share your thoughts!