Issue 23871: turning itertools.{repeat,count} into indexable iterables (original) (raw)
Issue23871
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) * ![]() |
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:15 | admin | set | github: 68059 |
2015-04-05 20:03:42 | r.david.murray | set | status: open -> closednosy: + r.david.murraymessages: + resolution: rejectedstage: resolved |
2015-04-05 08:45:03 | serhiy.storchaka | set | nosy: + rhettinger |
2015-04-05 08:38:58 | ztane | set | nosy: + ztanemessages: + |
2015-04-04 22:59:03 | Antony.Lee | create |