Closed 379dc349-3a10-424f-b9d2-a0104f092359 closed 9 years ago
itertools.repeat and itertools.count could be made into indexable iterables (rather than iterators), rather than iterators, like range is right now.
well, they wouldn't and shouldn't behave like range. range is a sequence whereas count or repeat wouldn't necessarily be sequences. (they can be infinite and thus not having length). And the count shouldn't be *reiterable* because that is why it exists (otherwise we could just use range). For repeat, indexing hardly matters.
I agree with Antti. If Raymond disagrees he can reopen :)
(There is a reason it is called *iter*tools. As Antti says, range is documented as being a *sequence* type.)
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields: ```python assignee = None closed_at =
created_at =
labels = ['library']
title = 'turning itertools.{repeat,count} into indexable iterables'
updated_at =
user = 'https://github.com/anntzer'
```
bugs.python.org fields:
```python
activity =
actor = 'r.david.murray'
assignee = 'none'
closed = True
closed_date =
closer = 'r.david.murray'
components = ['Library (Lib)']
creation =
creator = 'Antony.Lee'
dependencies = []
files = []
hgrepos = []
issue_num = 23871
keywords = []
message_count = 3.0
messages = ['240096', '240105', '240132']
nosy_count = 4.0
nosy_names = ['rhettinger', 'r.david.murray', 'Antony.Lee', 'ztane']
pr_nums = []
priority = 'normal'
resolution = 'rejected'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue23871'
versions = ['Python 3.5']
```