[PYTHON MATRIX-SIG] Slices
James Hugunin
jjh@Goldilocks.LCS.MIT.EDU
Wed, 3 Apr 96 13:44:35 EST
From: hinsenk@ere.umontreal.ca (Konrad HINSEN)
Another idea: introduce an object "index_expression" that can be
indexed to get an equivalent expression. Then
i = index_expression[2:4,...]
a[i]
would be equivalent to
a[2:4,...]
There would be no new syntax to learn; although users might have
to know that index expressions are really tuples if they want
to do something that is not possible with standard indexing.
Anybody who's interested in this idea can do the following under v0.35.
import Numeric
index_expression = Numeric.__slice_generating_class()
-Jim
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================