Can __iter__ be used as a classmethod?

Samuele Pedroni pedronis at
Thu Mar 6 14:38:37 CET 2003

"Alex Martelli" <aleax at> ha scritto nel messaggio
news:89G9a.12708$pG1.332485 at
> Actually, a very typical use case for class methods (in Smalltalk at
> least) is for *factories* -- which of course are only useful for
> classes that ARE meant to be instantiated, because they typically
> return class instances.


On Smalltalk and class methods:

in Smalltak class methods are methods on the meta class, a meta class is
automatically created behind the scene for each class, and class methods are
only accessible through the class as in:

MyClass metamethod...

myinst class metamethod...


myinst metamethod

would cause a message not understood exception.

More information about the Python-list mailing list