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.

The problem is that I don't know what to call such a thing! "Abstract class" isn't right, because that implies that you should subclass the class and then instantiate the subclasses.

What do you call such a class?


<nitpick>
Err... A possible design smell ?-)
</nitpick>


More seriously: this looks quite like a singleton, which in Python is usually implemented way more simply using a module and plain functions.

Do you have a use case for specializing this class ?

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

Reply via email to