Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upenumerate should be generic over the integer #22716
Comments
steveklabnik
added
A-libs
I-nominated
labels
Feb 23, 2015
This comment has been minimized.
This comment has been minimized.
|
nominating, like we've been doing for possible backompat-libs issue |
This comment has been minimized.
This comment has been minimized.
|
Isn't it likely to break code where the integer type can't be inferred? |
This comment has been minimized.
This comment has been minimized.
|
A little off-topic, but doesn't
=>
|
This comment has been minimized.
This comment has been minimized.
|
Python has both of them as well, I think it is common enough to warrant its On Tue, Feb 24, 2015, 09:30 Utkarsh Kukreti notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
|
E-needs-decision. cc @aturon 1.0 beta P-backcompat-libs. |
pnkfelix
added
I-needs-decision
P-backcompat-libs
labels
Feb 26, 2015
pnkfelix
added this to the 1.0 beta milestone
Feb 26, 2015
pnkfelix
removed
the
I-nominated
label
Feb 26, 2015
This comment has been minimized.
This comment has been minimized.
|
Personally I'm inclined to keep things simple and just use |
This comment has been minimized.
This comment has been minimized.
|
(The fact that zipping with |
This comment has been minimized.
This comment has been minimized.
|
Then I would honestly rather remove |
This comment has been minimized.
This comment has been minimized.
|
itertools already has a generic Standard .enumerate() is not crippled just because it's simple. It's one of a million possible iterator adaptors, and not all of them are going to be included in Rust by default. |
This comment has been minimized.
This comment has been minimized.
|
I personally see |
This comment has been minimized.
This comment has been minimized.
|
Well, then let's at least mention On Thu, Mar 19, 2015, 04:03 Alex Crichton notifications@github.com wrote:
|
This comment has been minimized.
This comment has been minimized.
|
Ok after some more discussion the conclusion is that we probably don't want to make |
This comment has been minimized.
This comment has been minimized.
|
triage: P-high () |
vks commentedFeb 23, 2015
Currently
enumerateusesusizefor counting. This is necessary when iterating over slices (probably the most common scenario). However, in general an iterator is not necessarily related to memory, so it may make more sense to use other integer types.It seems sensible to make
enumerategeneric over the integer type used for counting. This is backwards compatible, so it shouldn't break existing code.Would it be possible to make this change although
enumerateis marked as stable?