Re: [Numpy-discussion] immutable arrays

2006-09-21 Thread Martin Wiechert
On Thursday 21 September 2006 18:24, Travis Oliphant wrote: > Martin Wiechert wrote: > > Thanks Travis. > > > > Do I understand correctly that the only way to be really safe is to make > > a copy and not to export a reference to it? > > Because anybody having a reference to the owner of the data ca

Re: [Numpy-discussion] immutable arrays

2006-09-21 Thread Travis Oliphant
Martin Wiechert wrote: > Thanks Travis. > > Do I understand correctly that the only way to be really safe is to make a > copy and not to export a reference to it? > Because anybody having a reference to the owner of the data can override the > flag? > No, that's not quite correct. Of course

Re: [Numpy-discussion] immutable arrays

2006-09-21 Thread Martin Wiechert
Thanks Travis. Do I understand correctly that the only way to be really safe is to make a copy and not to export a reference to it? Because anybody having a reference to the owner of the data can override the flag? Cheers, Martin On Wednesday 20 September 2006 20:18, Travis Oliphant wrote: > M

Re: [Numpy-discussion] immutable arrays

2006-09-20 Thread Travis Oliphant
Martin Wiechert wrote: > Hi list, > > I just stumbled accross NPY_WRITEABLE flag. > Now I'd like to know if there are ways either from Python or C to make an > array temporarily immutable. > Just setting the flag Python: make immutable: a.flags.writeable = False make mutable again: a

[Numpy-discussion] immutable arrays

2006-09-20 Thread Martin Wiechert
Hi list, I just stumbled accross NPY_WRITEABLE flag. Now I'd like to know if there are ways either from Python or C to make an array temporarily immutable. Thanks, Martin. - Take Surveys. Earn Cash. Influence the Future of