Wed 3 Apr 2013
Last week, Matt Harrison sent me a copy of his latest Python eBook entitled Treading on Python Vol 2: Intermediate Python. I was intrigued since I rarely get to read Intermediate level Python books. In fact, I would say that some of the stuff that the author talks about goes into the advanced level. Anyway, I thought it was a pretty good little book and if you have a moment, I’ll tell you why.
- Why I picked it up: As I mentioned, the fact that it was an intermediate level book made this a must-read for me.
- Why I finished it: Because the book proved to be very interesting.
- I’d give it to: Python programmers who have a good understanding of the basics but are looking to grow in their Python skills.
Now if you have a few more minutes, you can read my full review after the jump!
This book is available on Amazon as a Kindle book only at the time of writing as far as I can tell. The copy I received was in epub format though, so there may be another version available somewhere…
Matt Harrison’s latest book is his best yet. I found the writing to be almost error free with only a smattering of typos here and there, mostly in the 2nd half of the book. The book is split up into 3 sections (not including the Introduction). Harrison doesn’t spend time introducing us to Python; instead he assumes you already know it and dives off into the deep end with functional constructs. Thus begins the first section in which he covers lambda, map, reduce, filter, recursion, list, set and dict comprehensions, and finally, the operator module. He used a lot of the topics that followed the lambda to illustrate advanced uses of the lambda construct. I thought it was intriguing and ended up learning some new tricks that I hope to implement in my own code soon.
The 2nd section is devoted to Iteration and Generators. In it, you will learn the difference between iterables and iterators, how to construct a normal generator and an object generator and the author also gives tips about when to use a generator versus a list. He also shows some real life examples of generators and iterators in the Python core. He does this a little in the first section as well.
The 3rd section is all about Functions, Closures and Decorators with a heavy emphasis on the latter. I think this section is a shorter, updated version of his book on Decorators actually as some of the examples looked kind of familiar. Regardless, it was very illuminating. I will admit that the “Alternate Decorator Implementations” section at the end of the book was rather confusing though.
In the end, I think this book is well worth the cost of owning it. You’ll almost certainly pick up something new just in the first section. If you don’t know much about generators, iterators or decorators in Python, then this book will help you figure it out and hopefully give you ideas of how you could use them in your code. I know I learned a few things (and probably re-learned a few others!).
Treading on Python Volume 2: Intermediate Python