2008 has been a good year for Python. We've had Python 3.0 released and the language keeps growing in popularity. It was also a great year for Python books.
Before this year, most Python books used to offer general learning or reference material. That is great, and a fan of the language will usually have a couple of those close at hand, but there's always been an empty space on my bookshelf waiting for more advanced subject matters.
For me, the book I had wanted to read as soon as I heard from it is Expert Python Programming. I've benefited from Tarek's work on both the Zope and Plone communities, plus I really liked his book's subjet matter, so I was really happy when Packt Publishing sent me a copy for review.
I'm far from a Python expert, so I'm kind of the audience the book is intended for. The objective is to show the reader how an advanced Python developer goes about his daily work and hopefully send him on the way to become one.
The book is structured around the concepts and processes of agile development. It goes from code writing to module and application organization; carefully considers distribution, code and life cycle management options; continues with testing and documentation practices and finishes up with optimization techniques.
Chapter one may seem a little out of place for an advanced book, since it covers Python installation and setup, but you may find some valuable information in there, like the introductions to Setuptools and iPython, or how to customize the initial Python prompt with a custom module that is imported at startup time.
Chapter two to four cover syntax best practices, PEP 8 programming standards and tips for appropriate naming. I found the sections on iterators and decorators specially useful.
Chapters five to seven show how to create a package and write an application, including using a common pattern for all packages, how to use code templates and preparing you code for distribution from the start. Coming from a deep Zope background, I appreciate the fact that zc.buildout is covered in detail and I hope the book helps Python developers not familiar with this and other Zope related technologies to get to know some of the hidden treasures from our community.
Chapters eight, and nine introduce best practices for code and project life cycle management. Source code control and versioning systems like Subversion and Mercurial are discussed, then Buildbot and Trac are introduced.
Chapter ten is a fairly deep look at documentation, starting not with tools but with writing advice and audience definition. The message is clear: one of the best things you can do for your code and its users is documenting it throughly. Sphinx and reStructuredText are also presented in this chapter.
Chapter eleven explains test-driven development, offering those who don't test sound arguments to begin doing it and those who test some advice and techniques for better testing. Nose is covered in some detail here.
Chapters twelve and thirteen deal with code optimization. The former covers how to profile and find bottlenecks and the latter offers specific help for finding solutions.
Chapter fourteen seems a little out of place with its coverage of useful design patterns in Python, but it's a good read anyway.
Throughout the book, the author does a wonderful job of covering the most recent and popular tools for developers available in the Python world. He doesn't try to be exhaustive, but clearly mentions alternatives to what he covers in detail and liberally points to resources on the net which offer more detail.
What I like about this is the acknowledgement that the book can only cover so much of what is available out there, and in any case may be out of date in that regard soon, but it can stay relevant by explaining why it's good to use some kind of tools and pointing at current examples.
This also means that the book does not go as deep as one would like into some subjects, which could be considered a drawback by some. I think the balance is right in this case as the book does cover a lot of material. If you are really serious about any of these topics, you are going to need to find more resources anyhow.
As it is, the book has 14 chapters and 342 pages. At $45, it's around the same price as similar books from other publishers. The book is of good quality and readability is OK, though the images could use a little work. I have read other books by Packt in the past and consider the topics offered and writing quality above average for this kind of books.
Overall, I sincerely recommend this book to any Python programmer. Right now, there are few books like this one in the market; it fills a need and does it well.