[Python-ideas] Using * in indexes
Greg Ewing
greg.ewing at canterbury.ac.nz
Wed Sep 15 00:15:10 CEST 2010
Mike Graham wrote:
> On Tue, Sep 14, 2010 at 12:16 AM, Greg Ewing
> <greg.ewing at canterbury.ac.nz> wrote:
>
>> self.data[..., *index, :]
>
> If in indexes, why not when making other tuples?
It would be handy to be able to use it when making other
tuples, yes. There's a particularly strong motivation
for it in relation to indexes, though, because otherwise
you not only end up having to use ugly (foo,) constructs,
but you lose the ability to use any of the special
indexing syntax.
There's also a performance penalty if you end up having
to look up 'slice' a bunch of times.
--
Greg
More information about the Python-ideas
mailing list