On 12/4/06, Terry Reedy <[EMAIL PROTECTED]> wrote: > While Fredrik's reply is a bit short, as is sometimes his habit, > here are some things that appear to me to not have been thought through > enough: > 1. some negative indexes are legal.
That could be fixed. Just substract len(L) from i if i < 0. > 2. replacing short inline code with a function call on *every* index lookup > will slow down the interpreter a bit. I can't notice any difference. On my machine, Python is compiled with -O3 which probably inlines the function. > 3. will the same check code work for even all built-in sequences? Atleast for tuple, string and list, they can be downcasted to PyVarObjects. So yes. > 4. how does index checking fit in with slice checking? When does slicing throw IndexErrors? > with both the knowledge and motivation to do so. But insulting such people > is not helpful. Agreed. I don't think insulting people is helpful at all, but I don't think "Russ" is the only one in this thread that should learn that. -- mvh Björn -- http://mail.python.org/mailman/listinfo/python-list