by Marty Alchin
- What’s this one about?
There are already a number of Python books available, but they tend to fall into two categories: some for getting started and others focusing on specific topics. Those are essential topics, but those two categories alone make it sound like the only way to learn more than just the basics is to be involved in a very specific type of project. The reality is that Python offers a wide range of more advanced features that can be applied to any application.
Pro Python will cover many of the tools and techniques that Python makes available to your applications, so you can easily incorporate them into your code. From the principles and philosophy that guide Python development to the mystery of metaclasses and beyond, there’s something for everyone.
Well, not quite everyone. Much like my last book, Pro Django, I’m proud to say that Pro Python is not for beginners. There are plenty of other resources out there to help you get started with Python, so if that’s what you need, I’d suggest first reading Dive Into Python 3 by Mark Pilgrim. Once you know your way around Python, Pro Python will take you the rest of the way.
- Now? Really?
If you’ve been using Python for very long, you’re probably already aware of the divide between Python 2 and Python 3. The Python community is beginning a long-term transition to a major shift in Python, with a number of incompatible changes between the two platforms. It’s a troubling time, but Pro Python looks to the future by covering the Python 3 line out of the box.
It’s too early to leave the past behind though, so Pro Python also includes compatibility notes on those features that were added, changed or removed in the past few releases of Python. You’ll be able to use the techniques presented in Python installations going back to version 2.5, with additional information about how those features are affected by more recent versions. You’ll learn how to:
- change your code to support Python 3,
- write code that’s compatible with as many versions of Python as possible, and
- implement features yourself if they’re not yet available in your current version of Python.
Thankfully, Python has frozen the core language for a while, so the changes that take place after Pro Python shouldn’t be fundamental enough to cause any problems. You can look forward to using Pro Python for a long time to come.
- How did it come to be?
While writing Pro Django back in 2008, it became clear that you can’t really understand a framework as complex as Django without first knowing about the Python features that make it possible. To my surprise, the chapter I wrote to cover those topics proved to be the most popular of the entire book. In fact, nearly every review of Pro Django called out its second chapter as the best in the entire book. To illustrate, I’ve included some of my readers’ feedback in the sidebar on this page.
With such fervent interest in coverage of general Python topics, I realized how great of an opportunity I had to finally expand on that chapter and cover everything I’d like to have included in Pro Django. Therefore, Pro Python showcases as much of Python’s advanced functionality as I can muster. It’s my hope that readers will come away with enough knowledge to turn their own applications into projects that might someday revolutionize the way people solve problems, just like Django did for the web.