[MATRIX-SIG] Change slice object?
Konrad Hinsen
hinsen@ibs.ibs.fr
Fri, 21 Nov 1997 19:07:04 +0100
> Also then there is no need for __getitem__ if one uses indexing. But I
> think the method is needed for the for-loop construct, right?
Right. And also for indexing with a single number, e.g. a[5].
> But in every function which deals with slicing, one can be shure to
> get only a tuple of slice objects.
True. Still it would break code that relies on the current interpretation.
It would probably break my netCDF module, for example.
> I don't see, how big the impact of this change would be to the other
> sequence objects in python.
None at all, because only arrays use multidimensional indexing and
slice objects!
> One other idea. What's the way to have a __cmp__ method for slice
> objects to test if a slice is completly in another slice or
> overlapping at both or only one end.
That could easily be done, but what would it be good for?
--
-------------------------------------------------------------------------------
Konrad Hinsen | E-Mail: hinsen@ibs.ibs.fr
Laboratoire de Dynamique Moleculaire | Tel.: +33-4.76.88.99.28
Institut de Biologie Structurale | Fax: +33-4.76.88.54.94
41, av. des Martyrs | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France | Nederlands/Francais
-------------------------------------------------------------------------------
_______________
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________