Lisandro Dalcin wrote:
> On 6/25/08, Robert Bradshaw <[EMAIL PROTECTED]> wrote:
>>
>>  > - Nobody complained about the [float64, 2]-syntax.
>>
>> No one has come up with anything better either, so lets run with it.
>>
>
> Has anybody considered the possibility of adding suport for dimension
> bounds, like in Fortran 90 ? Such a feature would add the possibility
> of checking the actual dimensions of numpy arrays (like F2Py does).

To clarify, do you mean the same as this:

cdef ndarray[float, 2] arr = x
assert arr.shape == (100, 29)

; only that you write

cdef ndarray[float, (100, 29)] arr = x

? Well, it can always be added later, I think the gains are fairly low and
that I would like to work on other things. (However, it does mean that if
you actually write code like

for i in range(99):
   arr[i, 2] = 34

...then you could drop the range checking on i with compiler optimizations
even if range checking is turned on. However, this is probably a rather
rare case...

Dag Sverre

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to