-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enumerate should be generic over the integer #22716
Comments
nominating, like we've been doing for possible backompat-libs issue |
Isn't it likely to break code where the integer type can't be inferred? |
A little off-topic, but doesn't
=>
|
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
|
E-needs-decision. cc @aturon 1.0 beta P-backcompat-libs. |
Personally I'm inclined to keep things simple and just use |
(The fact that zipping with |
Then I would honestly rather remove |
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. |
I personally see |
Well, then let's at least mention On Thu, Mar 19, 2015, 04:03 Alex Crichton notifications@github.com wrote:
|
Ok after some more discussion the conclusion is that we probably don't want to make |
triage: P-high () |
Currently
enumerate
usesusize
for 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
enumerate
generic 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
enumerate
is marked as stable?The text was updated successfully, but these errors were encountered: