G
Greg Ewing
Steven said: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.