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: turning itertools.{repeat,count} into indexable iterables
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: Antony.Lee, r.david.murray, rhettinger, ztane
Priority: normal Keywords:

Created on 2015-04-04 22:59 by Antony.Lee, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg240096 - (view) Author: Antony Lee (Antony.Lee) * Date: 2015-04-04 22:59
itertools.repeat and itertools.count could be made into indexable iterables (rather than iterators), rather than iterators, like range is right now.
msg240105 - (view) Author: Antti Haapala (ztane) * Date: 2015-04-05 08:38
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.
msg240132 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-04-05 20:03
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.)
History
Date User Action Args
2022-04-11 14:58:15adminsetgithub: 68059
2015-04-05 20:03:42r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg240132

resolution: rejected
stage: resolved
2015-04-05 08:45:03serhiy.storchakasetnosy: + rhettinger
2015-04-05 08:38:58ztanesetnosy: + ztane
messages: + msg240105
2015-04-04 22:59:03Antony.Leecreate