[SciPy-user] object_arrtype addition error

Travis Oliphant oliphant.travis at ieee.org
Mon Nov 28 21:39:45 CST 2005

Chris Fonnesbeck wrote:

>Under scipy_core, I have a dictionary that contains what I thought
>were floating point numbers, but are actually 'object_arrtype':
One question is why these are object array scalars (entries in an object 
array), instead of floating point numbers in the first place.  Perhaps 
there is something going on there.

>(Pdb) aic_quantiles
>{2.5: 345.38217627260781,
> 25: 346.73173987124062,
> 50: 347.50728308413125,
> 75: 349.61766516420937,
> 97.5: 361.87424170229531}
>(Pdb) type(aic_quantiles[50])
>Out[3]: <type 'object_arrtype'>
>When I try and add a scalar to any of these, I get a TypeError:
>(Pdb) aic_quantiles[50] + 4
>*** TypeError: unsupported operand type(s) for +: 'object_arrtype' and 'int'
>(Pdb) aic_quantiles[50] + 4.
>*** TypeError: unsupported operand type(s) for +: 'object_arrtype' and 'float'
No, this is not intended.  It looks like it is a side-effect from the 
recent changes to allow object arrays to punt to objects that defined 
rop operations.  It looks like the punting is pre-mature.


More information about the SciPy-user mailing list