Pythonic design patterns

Bruno Desthuilliers bdesth.quelquechose at
Thu Dec 4 21:45:46 CET 2008

Slaunger a écrit :
> Thank you all for sharing your views, links and suggestions on my
> question. I see where this is getting, and I have extracted the
> following points:
> 1. Many classic design patterns, especially the creational ones
> (Factory, etc.) aren't really that useful in Python as the built-in
> features in the language and the new style objects has ways of doing
> these things far more natural than statically types languages.

Well... I'd formulate it another way: many classic design patterns are 
either builtins or simply obvious in Python, so they are barely 
identifiable as such - at least if you fail to decouple the *design* 
pattern from it's canonical implementation(s). Remember that design != 
implementation !-)

> 2. Don't be religious about the design pattern and applying them too
> frantically. They may look cool, but there is a great danger for over-
> engineering and subsequent lower code readability, debuggability, and
> maintainability.

Indeed. And when you use one, try to implement it the pythonic way...


More information about the Python-list mailing list