Catalog of Python Patterns? [LONG!]
Jim Dennis
jimd at vega.starshine.org
Thu Apr 4 04:02:38 EST 2002
In article <mailman.1017886389.26908.python-list at python.org>, Delaney,
Timothy wrote:
>> From: Paul Rubin [mailto:phr-n2002a at nightsong.com]
>> jimd at vega.starshine.org (Jim Dennis) writes:
>>> At a minimum it should list each of the 23 GoF patterns, and
>>> at least one minimal Python implementation of that pattern.
>> Yucch, I've never been a fan of that book, it seems too cultish to me.
> More importantly, many of the patterns are not applicable to Python. _Design
> Patterns_ comes from a C/C++ point of view ... there is also _Design
> Patterns for Smalltalk_ (or something along those lines) which is apparently
> much more applicable.
Actually the GoF book has some C++ and some Smalltalk examples. They
aren't separate.
> It is useful to *know* the GoF patterns, but it is important not to be a
> slave to them.
>Tim Delaney
I agree that the book has somewhat of a cult following, and I'm
naturally wary of cults. I also agree that one should not be a
slave to fashion, and that some of the hype of "patterns" (and
XP, and ...) is "fashion" more than practical.
However, I'm trying to understand them well enough to distinguish
which parts of useful versus cosmetic.
I disagree (with one followup that's not quoted herein) that
patterns are not applicable to Python. The author of that comment
claimed that GoF was a C++ specific book (which is untrue, as I
point out above). Python is much more like Smalltalk than C++,
and the GoF specific chose it because it is a dynamic language
--- for its contrast to C++ and its ilk.
As I pointed out in my post, Python employs several patterns in
its core and standard libraries. Every class is a Factory, the
Bastion module returns Proxy objects, we see Iterators all over
the place, etc. So I still want to see more.
More information about the Python-list
mailing list