Book Image

Python Essentials

By : Steven F. Lott
Book Image

Python Essentials

By: Steven F. Lott

Overview of this book

Table of Contents (22 chapters)
Python Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


In this chapter, we've looked at two common metaprogramming techniques. The first is writing decorator functions—these can be used to transform an original function to add new features. The second is using a metaclass to extend the default behavior of class definitions.

We can use these techniques to develop application features that cut across many functions and classes. Writing a feature once and applying it to a number of classes assures us of consistency and can help during debugging, as well as upgrades or refactoring.

In Chapter 14, Fit and Finish – Unit Testing, Packaging, and Documentation, we'll look at a number of features that characterize a complete Python project. Rather than address technical language features, we'll look at ways we can use Python features to create polished, complete solutions.