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.

classification
Title: In itertools.repeat() object shadows object()
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.4
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: docs@python Nosy List: akuchling, docs@python, pitrou, py.user
Priority: normal Keywords: patch

Created on 2013-06-18 01:16 by py.user, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue18250.diff py.user, 2013-06-18 01:16 review
Messages (3)
msg191384 - (view) Author: py.user (py.user) * Date: 2013-06-18 01:16
>>> object
<class 'object'>
>>>
msg191505 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-06-20 08:33
I don't think this is a problem, since it is only a local variable in a function.
msg191549 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2013-06-21 01:26
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.
History
Date User Action Args
2022-04-11 14:57:47adminsetgithub: 62450
2013-06-21 01:26:41akuchlingsetstatus: open -> closed

nosy: + akuchling
messages: + msg191549

resolution: wont fix
stage: resolved
2013-06-20 08:33:40pitrousetnosy: + pitrou
messages: + msg191505
2013-06-18 01:16:44py.usercreate