Mastering Python, Second Edition by Rick van Hatten aims to help you “write powerful and efficient code using the full range of Python’s capabilities.”
It’s a big book, some 680 pages in print form, and well written. And it does indeed delve into Python’s “full range.” Even so, a few reviewers have commented that they wished the code examples went “deeper” than those provided by the author.
Personally, I like the short code examples. They are on almost every page and serve to illustrate the author’s points and descriptions. I like to type in the short code examples, run them, and then start experimenting with value changes or code changes to get a better feel for what is happening.
A note of caution: If you are new to programming in general and new to Python, hold off on getting this book until you get a better handle on Python’s basics. Mastering Python‘s first chapter deals with using Python in virtual environments and using one environment per project. I got confused for a while, because I had never used Python in a virtual environment before, and Chapter 1 presents several choices. It also gets into dependency managers–more choices to consider.
On the other hand, if you are now feeling the need to move beyond basic Python, this is a very good book to have on hand. Check out the links above to see how the book is structured. One surprise: Python generally is thought of as an object-oriented language. But one chapter of this new book covers functional programming with Python, and van Hatten makes a compelling case for it, noting: “One major advantage of writing purely functional code is that it becomes trivially easy to run in parallel.”
It’s not simple to write “efficient, maintainable, and reusable” code in any language, including Python, of course. And many experienced software developers who use Python do not use all of its capabilities, nor are they aware of all of its features and related tools. This book can be an excellent choice for intermediate-level Python developers or above, as well as those who feel they have finally gotten comfortable enough with Python to start making the jump to “intermediate.
— Si Dunn