Slice inconsistency?

Roberto A. F. De Almeida roberto at dealmeida.net
Sun Sep 28 14:48:17 CEST 2003


Stephen Horne <$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$.co.uk> wrote in message news:<qvrbnvgg5ji3sih8svd8i60dvhfbrs9nmi at 4ax.com>...
> All Roberto needs to do is make his class a subclass of object and it
> will do exactly what he needs - somebody did think about it and that
> PEP has apparently already been submitted and implemented a long time
> ago.

Yes, I think this is the best thing to do. It removes the (apparent or
not) inconsistency, and does what I would expect from the principle of
least surprise. The other solutions, like the Proxy class and Terry's
suggestion of adding a comma to uni-dimensional slices (c[:-1,]) are
interesting, but they are not consistent with Numeric slices. I'll
keep them in mind, though.

Thanks,

Roberto




More information about the Python-list mailing list