This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients docs@python, eric.smith, ezio.melotti, py.user, rhettinger
Date 2013-09-09.07:34:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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.
Date User Action Args
2013-09-09 07:34:57rhettingersetrecipients: + rhettinger, eric.smith, ezio.melotti, docs@python, py.user
2013-09-09 07:34:57rhettingersetmessageid: <>
2013-09-09 07:34:56rhettingerlinkissue18313 messages
2013-09-09 07:34:56rhettingercreate