[docs] [issue18250] In itertools.repeat() object shadows object()

A.M. Kuchling report at bugs.python.org
Fri Jun 21 03:26:42 CEST 2013

A.M. Kuchling added the comment:

Thanks for your bug report and patch, but I agree that we can't change this.  The repeat() function really does take 'object' as the keyword argument:

>>> from itertools import *
>>> list(repeat(times=3, object='abc'))
['abc', 'abc', 'abc']
>>> repeat(times=3, element='abc')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Required argument 'object' (pos 1) not found

Using 'object' is a minor wart, but I think it's not worth the backward
compatibility risk of changing it.  So the documentation needs to describe the actual keyword argument.

nosy: +akuchling
resolution:  -> wont fix
stage:  -> committed/rejected
status: open -> closed

Python tracker <report at bugs.python.org>

More information about the docs mailing list