__setitem__ puzzle

Anton Vredegoor anton at vredegoor.doge.nl
Mon Apr 21 13:57:42 EDT 2003


Alex Martelli <aleax at aleax.it> 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).

See the other post for some context for this class. I hope you'll like
it more after seeing that. However it's already too late to not start
writing it. (see Dijkstra's quote earlier in this thread).

Anton




More information about the Python-list mailing list