Algorithms as objects?

Bearophile bearophileHUGS at lycos.com
Thu Aug 27 20:00:36 EDT 2009


Chris Rebert:

> It sounds like you're describing the Strategy Pattern
> (http://en.wikipedia.org/wiki/Strategy_pattern).
>
> To have objects callable like functions, just implement the  __call__
> special method in your class(es):

Please, can't you just use a bit of functional-style programming? Like
creating nested functions on the fly, etc.

Bye,
bearophile



More information about the Python-list mailing list