Tim Rowe a écrit :
2008/9/22 Bruno Desthuilliers <[EMAIL PROTECTED]>:
Steven D'Aprano a écrit :
On Mon, 22 Sep 2008 10:11:58 +0200, Bruno Desthuilliers wrote:

Steven D'Aprano a écrit :
I have a class which is not intended to be instantiated. Instead of
using the class to creating an instance and then operate on it, I use
the class directly, with classmethods. Essentially, the class is used
as a function that keeps state from one call to the next.

Sounds to me like a functor, aka a function object:
http://en.wikipedia.org/wiki/Function_object


Ok, then the simple solution is to implement a callable type (__call__ method), possibly with appropriate support for the descriptor protocol if it's meant to be usable as a method.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to