This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brett.cannon
Recipients
Date 2003-05-12.23:48:46
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=357491

I don't see this as worth cluttering up slice notation.  I like gaul's suggestion 
of using a list comprehension to build your list.  Heck, you can even simplify 
the list comp to ``[a[x] for x in b]``.  Yes, it is not as short as ``a(b)``, but 
writing it out it looks like ``[10, 20, 30, 40, 50, 60, 70, 80, 90][[0, 4, 5, 
7]]`` which just looks *really* cluttered to me.

You also have the built-in 'slice' if you need real control over your slices.  So 
you could do your ``a[0:4, 3:4, 0:-1, -1]`` example as ``[a[slice(*args)] for 
args in [(0,4), (3,4), (0,-1), (-1,)]]``.

God I love list comps.  =)
History
Date User Action Args
2007-08-23 16:01:08adminlinkissue419903 messages
2007-08-23 16:01:08admincreate