[Numpy-discussion] Setting numpy record array elements
Stefan van der Walt
Tue Aug 21 01:40:16 CDT 2007
On Mon, Aug 20, 2007 at 06:26:30PM -0500, Sameer DCosta wrote:
> On 8/20/07, Stefan van der Walt <email@example.com> wrote:
> Thanks Stefan for offering to take a closer look. I have attached a
> patch against the latest svn which fixes this problem.
Yup, right on the money. The __setattr__ call sets the value of
a.col1, but a.col1 is in fact a pointer to a. It is
therefore necessary to use the setfields method.
I cannot think of any situation where you would need to call
__setattr__ on another member of "void", so I'm going to apply the
patch unless anyone objects.
More information about the Numpy-discussion