__setitem__ puzzle

Steve Holden sholden at holdenweb.com
Fri May 2 14:10:44 EDT 2003


"Alex Martelli" <aleax at aleax.it> wrote in message
news:EKUoa.67108$T34.1782963 at news2.tin.it...
> Anton Vredegoor wrote:
>
> > I have subclassed the builtin list type to accept tuples for indexing.
>
> ...apparently to deal with nested lists, if I read you right.  I don't
> like that; I've long thought that L[seq] should be [L[x] for x in seq],
> and L[seq]=seq1 should be like
>
>     for i, v in zip(seq, seq1): L]i] = v
>
> with the added constraint that len(seq) == len(seq1).
>
So, why isn't it?

devil's-advocate-ly y'rs  - steve
--
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/







More information about the Python-list mailing list