Mark Dickinson <[EMAIL PROTECTED]> writes: > > So use: return sum(number_list) / float(len(number_list)) > > That makes it somewhat more explicit what you want. Otherwise > > But that fails for a list of Decimals...
Again, that depends on what your application considers to be failure. Heck, int/int = float instead of decimal might be a failure. FWIW, I just checked Haskell: int/int is not allowed (compile time type error). There is an integer division function `div`, like Python's //, . that you can use if you want an integer quotient. If you want a floating or rational quotient, you have to coerce the operands manually. Explicit is better than implicit. -- http://mail.python.org/mailman/listinfo/python-list