Re: Crash or return forbidden value?
- Posted by Matt Lewis <matthewwalkerlewis at gmai?.c?m> May 08, 2008
- 628 views
CChris wrote: > > Bernie Ryan wrote: > > > > > 3. Requesting an out of bounds index for a given sequence. Crash. This > > > tends > > > to be a programmers fault, not a users fault. The methods find_from, > > > rfind_from, > > > etc... do this. > > > > The programmer should be doing any necessary bounds checking ? > > > > Why do it twice, since the backend always cjecks? There should be some sort > of runtime warning, because it may be a program bug. But if the only point > is to exit a loop when there is nothing left to process, let's use the > logic built into the interpreter, rather than duplicationg it. Maybe we're thinking about widely different things, but I can't figure out what you mean here. But maybe you want to check, because it tells you some data is bad. That doesn't mean that you have to crash, just that you should stop processing, or whatever. Can you explain what you mean here? Matt