From: Sasha <nd...@ma...> - 2006-06-14 16:39:26
|
On 6/14/06, Martin Wiechert <mar...@gm...> wrote: >... > does anybody know, why > > maximum.reduce (()) > > does not return -inf? > Technically, because >>> maximum.identity is None True It is theoretically feasible to change maximum.identity to -inf, but that would be inconsistent with the default dtype being int. For example >>> add.identity, type(add.identity) (0, <type 'int'>) Another reason is that IEEE special values are not universally supported yet. I would suggest to add 'initial' keyword to reduce. If this is done, the type of 'initial' may also supply the default for 'dtype' argument of reduce that was added in numpy. Another suggestion in this area is to change identity attribute of ufuncs from a scalar to dtype:scalar dictionary. Finally, a bug report: >>> add.identity = None Traceback (most recent call last): File "<stdin>", line 1, in ? SystemError: error return without exception set |