Steven Bethard wrote:
I'd argue that for the same reasons that dict.fromkeys is a dict classmethod, the itertools methods could be iter classmethods (or staticmethods). The basic idea being that it's nice to place the methods associated with a type in that type's definiton. The parallel's a little weaker here because calling iter doesn't always produce objects of type iter:

Indeed, I see iter() as being more like len(), which is clearly a function, not a constructor. Making iter() a type and giving it class methods would be strange.

--
Greg Ewing, Computer Science Dept,
University of Canterbury,       
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to