G+: Design Patterns in Python [Slide deck by +Alex …

David Coles
Design Patterns in Python [Slide deck by +Alex Martelli at Google]

One issue I've run into with writing object oriented code in Python is a lot of the traditional static-language design patterns you see in Java and C++ don't directly apply. For example, there's no final or private keywords to prevent sub-classes from extended or overriding methods. Fortunately there exists a family of design patterns designed for dynamic languages like Python and Smalltalk.

The two patterns I've found most useful are the "Template Method" pattern and the "Adapter" pattern. Both can be used to ensure that certain behavior from an object. The slides also cover some of the more theoretical reasons why these patterns are useful and the more practical side of how you can use them in Python.

http://www.aleax.it/gdd_pydp.pdf