[Patches] [Patch #100759] range-lists: [1:10] (relative to list comprehensions patch)
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 15 Aug 2000 16:40:53 -0700
Patch #100759 has been updated.
Project:
Category: None
Status: Deleted
Summary: range-lists: [1:10] (relative to list comprehensions patch)
Follow-Ups:
Date: 2000-Jul-07 16:09
By: twouters
Comment:
This patch (which is relative to the list comprehension patch, because it isn't likely to go in before listcomp, and they clash at a couple of places) adds built-in range-creation, exactly like the range() builtin, but without the ability to override the behaviour by masking the builtin with a global or local range() ;)
[10:100:2] is exactly the same as range(10, 100, 2). Assignment to range-literals is not possible, nor is 'chaining' them inside a single list. They do work well with list comprehension:
[ x * 2 for x in [1:100] if x % 3]
Also, the patch contains some code duplication (about the entire build_range function, plus get_len_of_range()) I'm not sure how to properly solve that: is it okay for compile.c to rely on something from bltinmodule.c ? If not, should I move the common functionality into listobject.c ?
-------------------------------------------------------
Date: 2000-Jul-07 16:12
By: twouters
Comment:
Oh, and before anyone gets the wrong impression, this idea was not mine; Guido suggested I try and implement it.
-------------------------------------------------------
Date: 2000-Aug-15 16:40
By: tim_one
Comment:
Changed status from Out-of-date to Deleted, as this patch was essentially resubmitted as 100902.
-------------------------------------------------------
-------------------------------------------------------
For more info, visit:
http://sourceforge.net/patch/?func=detailpatch&patch_id=100759&group_id=5470