-
Notifications
You must be signed in to change notification settings - Fork 300
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
Reconsider negative indexing? #435
Comments
The current status is:
My thoughts on this are:
@droundy Do you agree that @bluss and others: What are your thoughts on this? Edit: I realized that while we could have |
I agree that allowing usize would greatly reduce the danger of allowing negative indices. Personally, I'd still prefer a solution for counting backwards that is more like normal rust. |
Just to clarify, you can currently use |
My lousy 2 cents, one month later:
|
Hi, I just want to say that I really like END-7. I'm using Python a lot, and I have had some bugs with negative indexes which weren't meant to be negative. I understand that requiring usize should prevent that, but I don't really like the requirement to use usize. In a program I wrote I had to write "as usize" many times, and it wasn't pleasant. OTOH, END-7 is very explicit in what it means, and also easy to type. |
I've not yet used ndarray, but looking at its description, it sounds like it follows Python's approach of using negative indices to could back from the end of an array? I would strongly suggest reconsidering that. It is the feature of numpy that in my experience most commonly results in hard to find bugs for now users.
The text was updated successfully, but these errors were encountered: