On Tue, Sep 02, 2003 at 01:20:17PM -0600, Fernando Perez wrote:
Todd Miller wrote:
I thought about this a lot yesterday and today talked it over with Perry. There are several ways to fix the problem with mean() and sum(), and I'm hoping that you and the rest of the community will help sort them out.
[snip]
Just a thought: why not make the upcasting an optional parameter?
I've found that python's arguments with default values provide a very convenient way of giving the user fine control with minimal conceptual overhead.
I'd rather write:
arr = array([255, 255], Int8) ... later arr.sum(use_double=1) # or some similar way of tuning sum()
+1, but arr.sum(typecode=Float64) would be my choice of spelling. Not sure what the default typecode should be, though. Probably Perry's suggestion: the largest type of the family. -- Robert Kern kern@caltech.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter