Guido van Rossum wrote: ...
Vice versa, if at all, I suggest a built in /% operator as a faster equivalen to single / and %, but I believe this code can be used more efficiently. divmod should be a special case of an algebraic extension module and removed from the builtins.
That would have to be //% to be in line with the // operator, of course. But I'd rather spend the effort towards making the compiler smart enough to recognize that divmod is a built-in so it can generate more efficient code (and I *am* prepared to make the necessary -- slight -- changes to the language so that the compiler can make this deduction safely).
I stand corrected. And yes, catching certain builtins sounds like an optimzation path that is still open. Hey, len would have an incredible boost!!!
divmod does not save computation time, does not reduce programming time, does not simplify programs, eats paper and code space
mm, ss = divmod(ss, 60)
easier to read than
mm, ss = ss//60, ss%60
Sure it is. Until Silvester night, I even had no idea that divmod is so drastically slower. Hee hee. Which gave me a nice chance to start a whole rant towards shrinking the language, which I found an attractive new way to shake you up.
Don't take it too serious :-))
I-wish-you-a-divmod-ly-new-2003-and-all-the-best -- chris