![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Raymond Hettinger added the comment: All of the proposed variants have their own issues. For example, the keyword-argument variant behaves badly if the user leaves off the keyword:
list(repeatfunc(ord, 'A', times=3)) [65, 65, 65] list(repeatfunc(ord, 'A', 3)) Traceback (most recent call last): File "<pyshell#12>", line 1, in <module> list(repeatfunc(ord, 'A', 3)) TypeError: ord() takes exactly one argument (2 given)
I prefer to leave the recipe as is. The primary purpose of the recipe is to illustrate how starmap() and repeat() can be used together. Will that knowledge, a user can easily cobble together in-line code for either the finite version or the infinite iterable version. ---------- priority: normal -> low resolution: -> rejected status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18313> _______________________________________