[SciPy-dev] 'O' type arrays and containers as values...
Fernando Perez
Fernando.Perez at colorado.edu
Fri Nov 4 17:25:23 EST 2005
Travis Oliphant wrote:
> I just added the special-case check so that now single-item assignment
> works as expected
> for object arrays. It's in SVN.
Many thanks, Travis. You made the right choice :)
> It's still ambiguous as to what to do with initialization from container
> types.
>
> For example,
>
> array([[1,2,3],[3,4,5]],'O') produces an 2x3 array of integer objects.
> Or did you want a 1x2 array of list objects?
>
> Not sure how to fix that one without a special-purpose object array
> creation function that fixes the shape.
Yes, this one is nasty. I'd say leave it, because it will match most closely
the behavior of the default constructor, and honestly I can't think of a
better approach. But I think fixing the assignment problem was a real wart,
not an inherent ambiguity as in this case.
Best,
f
More information about the SciPy-Dev
mailing list