Skip to content
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

Allow list literals ranges of the form a ... b #7991

Closed
pwbecker opened this issue Jan 19, 2013 · 4 comments

Comments

@pwbecker
Copy link

@pwbecker pwbecker commented Jan 19, 2013

Enhancement request:

Allow list literals to be ranges of the form a ... b

As in

for (x in [0 ... 10])

This would also solve the problem of accessing indexes within for loops (or iterate in web_ui)
  

@sethladd

This comment has been minimized.

Copy link
Member

@sethladd sethladd commented Jan 20, 2013

Removed Type-Defect label.
Added Type-Enhancement, Area-Language, Triaged labels.

@pwbecker

This comment has been minimized.

Copy link
Author

@pwbecker pwbecker commented Jan 21, 2013

Apologies for missing the summary line. Should read:
"Allow list literals ranges of the form a ... b"

@gbracha

This comment has been minimized.

Copy link
Contributor

@gbracha gbracha commented Jan 22, 2013

Set owner to @gbracha.
Added Accepted label.
Changed the title to: "Allow list literals ranges of the form a ... b".

@munificent

This comment has been minimized.

Copy link
Member

@munificent munificent commented Dec 19, 2016

This would make it really easy to create lists that allocate a monumental amount of memory when all you really want to do is loop through them. It could return an Iterable instead, but then the [ ... ] syntax starts to look misleading.

For a more general "do something for ranges", we'll use #26307 to track that. I'm going to close this one because I don't think we want a solution that involves actually creating a list of numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.