[Numpy-discussion] numpy.mean still broken for largefloat32arrays

Robert Kern robert.kern at gmail.com
Sun Jul 27 04:24:58 EDT 2014


On Sun, Jul 27, 2014 at 7:04 AM,  <josef.pktd at gmail.com> wrote:
>
> On Sat, Jul 26, 2014 at 5:19 PM, Sturla Molden <sturla.molden at gmail.com>
> wrote:
>>
>> Robert Kern <robert.kern at gmail.com> wrote:
>>
>> >> It would presumably require a global threading.RLock for protecting the
>> >> global state.
>> >
>> > We would use thread-local storage like we currently do with the
>> > np.errstate() context manager. Each thread will have its own "global"
>> > state.
>>
>> That sounds like a better plan, yes :)
>
> Any "global" state that changes how things are calculated will have
> unpredictable results.
>
> And I don't trust python users to be disciplined enough.
>
> issue: Why do I get different results after `import this_funy_package`?

That's why the suggestion is that it be controlled by a context
manager. The state change will only be limited to the `with:`
statement. You would not be able to "fire-and-forget" the state
change.

-- 
Robert Kern



More information about the NumPy-Discussion mailing list