On 09/01/2014 16:30, Mark Lawrence wrote: > On 09/01/2014 16:21, Roy Smith wrote: >> >> No, it would be solved by a built-in method. Recipes are a cop-out. >> If something is complicated enough to require a recipe, and used >> frequently enough to be worth writing that recipe up and documenting >> it, you might as well have gone the one additional step and made it a >> method. >> > > So all of the itertools recipes should be part of the Python module and > not in more-itertools on pypi?
To be fair, Mark, it's a matter of taste. Raymond [the author/maintainer of itertools] prefers not to multiply the API; other developers might legitimately make other calls. Sometimes the cut-off is more obvious; say, when the effort to make a recipe general purpose creates an over-engineered API. Other times it's just preference. Does that mean that every recipe ever conceived should be stuffed into the class or module it uses? No; but it doesn't rule out adding things which are genuinely useful. I think the new statistics module has hit a nice balance on its initial release: it's a stripped down aesthetic without precluding later additions. TJG -- https://mail.python.org/mailman/listinfo/python-list