Julien Danjou’s Serious Python: Black-Belt Advice on Deployment, Scalability, Testing, and More is serious.
This book takes Python programming well beyond casual programming, and beyond the use of Python as a glorified scripting language to access statistical or graphics tools, etc. This is level one or even level two material. If you are writing software to distribute to others, handling time zones, want to optimize code, or experiment with different programming paradigms (i.e. functional programming, generating code, etc.) then you will find Serious Python informative and interesting. Multi-threading, optimization, scaling, methods and decorators, and integration with relational databases are also covered. (A decorator is a function that “decorates,” or changes or expands, a function without motifying i.) The material is carefully and richly explored, and the writing is clear and concise.
An example of the kind of information in this book: Objects you create in your Python programming have to be kept track of by Python. But you might create simple objects that can’t, and don’t need to, do much. Such an object still carries with it overhead as thought the object might be asked to do more. But if it never will be, you can create a simper version of that object that is less powerful (but powerful enough) but that uses, maybe, 20% of the memory space to exist, which can add up if this is an object you need a lot of instances of. But is that always the best solution? What if you don’t need the object to be stored with full-on meta-information, but you do want something more than the simplest possible. There is a way to do that too, so you get considerable memory savings but maybe not as much. This book tells you how to do this.
Another example: Say you have a function that does nothing but return a single value, and you use it a lot. But, the value you send it, while it varies across the use of the program (otherwise you wouldn’t have a function, most likely) it is often the same. You are computing a simple conversion, but over several thousand conversions, there are only a few hundred possible values you ever actually convert. Wouldn’t it be great to have the ability to cache the results of a function, so if the same thing is asked of it again, it simply returns the previously calculated value rather than re-doing what it just did? Well, you can do that, it is in this book.
This is a great advanced Python book. To give you a better idea if it is good for you, specifically, here is the TOC:
Chapter 1: Starting Your Project
Chapter 2: Modules, Libraries, and Frameworks
Chapter 3: Documentation and Good API Practice
Chapter 4: Handling Timestamps and Time Zones
Chapter 5: Distributing Your Software
Chapter 6: Unit Testing
Chapter 7: Methods and Decorators
Chapter 8: Functional Programming
Chapter 9: The Abstract Syntax Tree, Hy, and Lisp-like Attributes
Chapter 10: Performances and Optimizations
Chapter 11: Scaling and Architecture
Chapter 12: Managing Relational Databases
Chapter 13: Write Less, Code More
Author Julien Danjou is a Principal Software Engineer at Red Hat and a contributor to OpenStack, the largest existing open source project written in Python. He has been a Free Software and Open Source hacker for the past 15 years.