Sorry about all the posts, but I just now realized what you are saying....

well:
- I write an algorithm where I don't care about speed and use negative indices
- someone else takes it and turns off bounds checking as it doesn't raise any 
indexerrors, so "why not"?
- poof!

I think this would be very obscure. The recipe people would tend to follow 
seems to be "run with bounds checking on, if all the tests pass then you can 
turn it off". This would break that way of working.

I vote for a new compiler directive to do this, and then a new higher-level 
directive including both this and bounds checking. Alternatively, a buffer 
option allow_negative which is set to True by default.

Dag Sverre Seljebotn
-----Original Message-----
From: Robert Bradshaw <[EMAIL PROTECTED]>
Date: Sunday, Aug 17, 2008 6:55 am
Subject: [Cython] Boundchecking question
To: Cython-dev <[email protected]>Reply-To: [email protected]

I've been playing with the (very cool!) buffer stuff Dag did getting  
>ready for the SciPy conference. I've seen a 20% increase in speed not  
>adjusting for negative indices, but making sure the indices are  
>unsigned is a pain (especially if there is arithmetic involved). One  
>proptosal that has been brought up is to make positive integer  
>constants unsigned, which could lead to complications elsewhere and  
>would still require care. Another proposal that I'd like to throw out  
>there is to have negative index realigning part of bounds checking,  
>i.e. negative indices are not checked for if bounds checking is off.
>
>Thoughts?
>
>- Robert
>
>_______________________________________________
>Cython-dev mailing list
>[email protected]
>http://codespeak.net/mailman/listinfo/cython-dev
>

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

Reply via email to