Re: [sympy] Is using evaluate contextmanager safe?

2020-08-02 Thread Paul Royik
Got it. Thanks. On Sunday, August 2, 2020 at 12:00:47 PM UTC+3, Oscar wrote: > > On Sun, 2 Aug 2020 at 06:32, Paul Royik > > wrote: > > > > Do you mean that now it is not safe to use evaluate=True in one thread > and evaluate=False in another? > > It is always fine to use

Re: [sympy] Is using evaluate contextmanager safe?

2020-08-02 Thread Oscar Benjamin
On Sun, 2 Aug 2020 at 06:32, Paul Royik wrote: > > Do you mean that now it is not safe to use evaluate=True in one thread and > evaluate=False in another? It is always fine to use evaluate=True/False. The problem is with using the global evaluate flag: In [7]: with evaluate(False): ...:

Re: [sympy] Is using evaluate contextmanager safe?

2020-08-01 Thread Paul Royik
Do you mean that now it is not safe to use evaluate=True in one thread and evaluate=False in another? On Saturday, August 1, 2020 at 10:40:19 PM UTC+3, Oscar wrote: > > On Sat, 1 Aug 2020 at 18:40, Paul Royik > > wrote: > > > > In sympy.core.parameters it is written that "WARNING! Although

Re: [sympy] Is using evaluate contextmanager safe?

2020-08-01 Thread Oscar Benjamin
On Sat, 1 Aug 2020 at 18:40, Paul Royik wrote: > > In sympy.core.parameters it is written that "WARNING! Although the global > parameters are thread-local, SymPy's cache is not by now. This may lead to > undesired result in multi-threading operations." > But in code I see > > def

[sympy] Is using evaluate contextmanager safe?

2020-08-01 Thread Paul Royik
In sympy.core.parameters it is written that "WARNING! Although the global parameters are thread-local, SymPy's cache is not by now. This may lead to undesired result in multi-threading operations." But in code I see def __setattr__(self, name, value): if getattr(self, name) != value: