Serious Python

Serious Python

Black-Belt Advice on Deployment, Scalability, Testing, and More
by Julien Danjou
December 2018, 240 pp.
ISBN-13: 
9781593278786
Lay-flat binding

"Serious Python contains a considerable amount of judicious battle-tested advice from an experienced developer—as well as some insightful gems from the guest contributors—making the overall effort a welcome addition to the limited number of books aimed at more advanced Python programmers."
Michael J. Ross, web developer and former Slashdot contributor.


Download Chapter 6: Unit Testing

Sharpen your Python skills as you dive deep into the Python programming language with Serious Python. You’ll cover a range of advanced topics like multithreading and memorization, get advice from experts on things like designing APIs and dealing with databases, and learn Python internals to help you gain a deeper understanding of the language itself. Written for developers and experienced programmers, Serious Python brings together over 15 years of Python experience to teach you how to avoid common mistakes, write code more efficiently, and build better programs in less time.

As you make your way through the book’s extensive tutorials, you’ll learn how to start a project and tackle topics like versioning, layouts, coding style, and automated checks. You’ll learn how to package your software for distribution, optimize performance, use the right data structures, define functions efficiently, pick the right libraries, build future-proof programs, and optimize your programs down to the bytecode.

You’ll also learn how to:

  • Make and use effective decorators and methods, including abstract, static, and class methods
  • Employ Python for functional programming using generators, pure functions, and functional functions
  • Extend flake8 to work with the abstract syntax tree (AST) to introduce more sophisticated automatic checks into your programs
  • Apply dynamic performance analysis to identify bottlenecks in your code
  • Work with relational databases and effectively manage and stream data with PostgreSQL

If you’ve been looking for a way to take your Python skills from good to great, Serious Python will help you get there. Learn from the experts and get seriously good at Python with Serious Python!

Author Bio 

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.

Table of contents 

Introduction

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

Index

View the detailed Table of Contents
View the Index

Reviews 

"Serious Python contains a considerable amount of judicious battle-tested advice from an experienced developer—as well as some insightful gems from the guest contributors—making the overall effort a welcome addition to the limited number of books aimed at more advanced Python programmers."
—Michael J. Ross, web developer and former Slashdot contributor

“An interesting book . . . While some of the topics that are covered seem pretty obvious, I don’t actually see very many authors or bloggers talking about them all that often.”
—Mike Driscoll, Mouse Vs. Python

“This book could easily have been ten times its current length, but I like that it is to the point and it does a great job guiding the reader through the most important topics that aren't always covered by other books. Serious Python is a book you need to read if you're serious about following mature processes and being a capable Python programmer. It's filled with practical information that's normally scattered across web tutorials, conference talks, and Stack Overflow posts, but has been compiled here into one an excellent book. 5 stars.”
—Al Sweigart, author of Automate the Boring Stuff with Python and many other No Starch Press titles

Serious Python by Julien Danjou is an outstanding book for those who already have gone through beginner’s guides and tutorials or already have experience of other programming languages. This book teaches you how to write Python code in an expert way. The chapters are not just covering the mere syntax but take your Python skills to a new level.”
—Miranda Limonczenko, Books on Code

This book takes Python programming well beyond casual programming and beyond the use of Python as a glorified scripting language . . . A great advanced Python book.”
—Greg Laden, GregLaden.com

Updates 

View the latest errata.