Refine your Python programming skills and build professional grade applications with this comprehensive guide
Key FeaturesCreate manageable code that can run in various environments with different sets of dependenciesImplement effective Python data structures and algorithms to write optimized codeDiscover the exciting new features of Python 3.7Book DescriptionPython is a dynamic programming language that's used in a wide range of domains thanks to its simple yet powerful nature. Although writing Python code is easy, making it readable, reusable, and easy to maintain is challenging. Complete with best practices, useful tools, and standards implemented by professional Python developers, the third edition of Expert Python Programming will help you overcome this challenge.
The book will start by taking you through the new features in Python 3.7. You'll then learn the advanced components of Python syntax, in addition to understanding how to apply concepts of various programming paradigms, including object-oriented programming, functional programming, and event-driven programming. This book will also guide you through learning the best naming practices, writing your own distributable Python packages, and getting up to speed with automated ways of deploying your software on remote servers. You’ll discover how to create useful Python extensions with C, C++, Cython, and CFFI. Furthermore, studying about code management tools, writing clear documentation, and exploring test-driven development will help you write clean code.
By the end of the book, you will have become an expert in writing efficient and maintainable Python code.
What you will learnExplore modern ways of setting up repeatable and consistent development environmentsPackage Python code effectively for community and production useLearn modern syntax elements of Python programming such as f-strings, enums, and lambda functionsDemystify metaprogramming in Python with metaclassesWrite concurrent code in PythonExtend Python with code written in different languagesIntegrate Python with code written in different languagesWho this book is forThis book will appeal to you if you’re a programmer looking to take your Python knowledge to the next level by writing efficient code and learning the latest features of version 3.7 and above.
Table of ContentsCurrent Status of PythonModern Python Development EnvironmentsModern Syntax Elements - Below the Class LevelModern Syntax Elements - Above the Class LevelElements of MetaprogrammingChoosing Good NamesWriting a PackageDeploying the CodePython Extensions in Other LanguagesManaging CodeDocumenting Your ProjectTest-Driven DevelopmentOptimization - Principles and Profiling TechniquesOptimization - Some Powerful TechniquesConcurrencyEvent-Driven and Signal ProgrammingUseful Design PatternsreStructuredText Primer
The authors use "half a loaf is better than none" on page 545 in reference to run_in_executor, and that saying is also applicable to their book. Expert Python Programming is not a good book, but it's also not entirely without value.
The editing could be better. Either no native English speakers were involved, or they didn't have enough time to work with the Polish and French authors' prose. A next section promised on page 391 never appears. On page 546 there are two different next chapters. There's even a code block on page 576 that is printed with all the newlines stripped out.
Beyond simple issues, explanation is sometimes poor or missing. The token bucket explanation is particularly unclear. They say that Python string concatenation is quadratic, but they don't explain why. On page 496 they suggest that non-deterministic caching has been solved numerous times, so the reader can just go look on PyPI.
The publication date of this third edition is April 2019, and yet there's no mention of Pipenv. They still say py.test rather than pytest. They mention nose but not nose2. Chunks of the book refer to Python 3.5, while the cover promises 3.7.
The perspective of the authors is unfamiliar to me, as when they say on page 187 that "Using binary bit-wise operations to combine options is common in Python."
I'd like to be able to trust the completeness of a book like this. If it doesn't know about Pipenv, what else is it missing that should really be included?
But it isn't all bad. I don't recall seeing the Python 3.7 asyncio.run(), but the larger-scale explanations of asyncio weren't awful. If I'm understanding properly, the interesting thing about await is that it doesn't wait, in the sense of blocking.
So I'm not upset that I read the book. I suspect the authors are technically competent people who did the best they could with limited resources from Packt. The book contains their take on things, and it broadened what I was aware of.