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. =) |