Slice inconsistency?

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

Stephen Horne <$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$> wrote in message news:<qvrbnvgg5ji3sih8svd8i60dvhfbrs9nmi at>...
> 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.



More information about the Python-list mailing list