Can __iter__ be used as a classmethod?

Michael Hudson mwh at
Tue Mar 11 14:39:30 CET 2003

"Greg Ewing (using" <me at> writes:

> Alex Martelli wrote:
> > Aren't these reasons enough?  How else would you code a method that
> > you can indifferently call either on any instance or on the class
> > object itself?
> How often do people actually *need* that functionality, though?

I've done it, but I can't remember why :-)

> Can someone provide a compelling use case for this in Python?

Depends what you mean by "compelling" of course.  I see little harm in
having them.


  The meaning of "brunch" is as yet undefined.
                                             -- Simon Booth,

More information about the Python-list mailing list