Book Image

Secret Recipes of the Python Ninja

Book Image

Secret Recipes of the Python Ninja

Overview of this book

This book covers the unexplored secrets of Python, delve into its depths, and uncover its mysteries. You’ll unearth secrets related to the implementation of the standard library, by looking at how modules actually work. You’ll understand the implementation of collections, decimals, and fraction modules. If you haven’t used decorators, coroutines, and generator functions much before, as you make your way through the recipes, you’ll learn what you’ve been missing out on. We’ll cover internal special methods in detail, so you understand what they are and how they can be used to improve the engineering decisions you make. Next, you’ll explore the CPython interpreter, which is a treasure trove of secret hacks that not many programmers are aware of. We’ll take you through the depths of the PyPy project, where you’ll come across several exciting ways that you can improve speed and concurrency. Finally, we’ll take time to explore the PEPs of the latest versions to discover some interesting hacks.
Table of Contents (17 chapters)
Title Page
Copyright and Credits
Packt Upsell
Foreword
Contributors
Preface
Index

Foreword

The Secret Recipes of the Python Ninja provides an array of Python programming topics. Cody Jackson has detailed a comprehensive selection of recipes that cover a broad spectrum of topics.

The first two chapters cover numerous features of the Python ecosystem and Python interpreter. These topics are outside the narrow space of the language's syntax and semantics; they cover important topics of software installation, packaging, maintenance, and operation. It's helpful for ninjas working in a DevOps role to have these kinds of recipes at hand.

In chapters three, four, and six, Cody covers topics in the Python language and standard library, including a number of ways of using decorators, the collections module, and other widely used modules, including math, random secrets, and statistics. These modules are the foundation of many important pieces of Python software.

Chapter five covers concurrency at a deep level using the OS and threading modules, as well as a higher-level multiprocessing module. This provides a number of alternative implementation techniques for improving performance. Chapter seven delves into PyPy and the RPython project to show additional ways to create high-performance software.

The Python Enhancement Proposals (PEPs) are an important part of the overall Python ecosystem that leads to wide adoption of the language. The PEP process is how changes to the language and standard library are evaluated and discussed. The Secret Recipes of the Python Ninja exposes this process, helping developers understand how change happens and provides background for participating in the open source community.

No project can be called complete unless is has useful, readable documentation. The Python ecosystem has a number of tools for creating documentations along with the working code. Tools like Sphinx, PyDoc, and LyX will help create a useful, enduring product.

Secret Recipes of the Python Ninja is focused on developers who have some exposure to the language's statements and data structures. The opening chapters speak to a need to deeply understand the larger context of installation and operation that surround Python programming. This book is an ideal resource for people involved in DevOps tasks.

The content goes beyond the basics of DevOps. People involved in quality engineering will find this book helpful when paired with a book on Python testing techniques.

While there are many books on Python language and data structures, there don't seem to be enough resources that help navigate the ecosystem that has developed around the language.

The ninja metaphor calls to mind the idea of irregular tactics. Instead of relying on large armies and brute force, these recipes show how the right technique applied at the right time can have a dramatic impact in making code usable, available, and high performance.

A Python ninja uses their secret weapons to create valuable software efficiently. Cody Jackson takes away the mystery, helping you work more effectively with Python.

 

 

Steven F. Lott

Master Software Engineer, Capital One and best selling Python author