Le lundi 12 mars 2012 à 14:18 -0600, Aaron Meurer a écrit : > On Mon, Mar 12, 2012 at 1:42 PM, Ronan Lamy <[email protected]> wrote: > > Le lundi 12 mars 2012 à 20:13 +0100, [email protected] a > > écrit : > >> I thought that the old module is deprecated and it is to be removed. > >> In the new module all assumptions are "property cashes" as you put it > >> if I am not mistaken. > > > > The old assumptions are a fundamental part of the core, so they can't > > just be removed, or deprecated in any meaningful way. > > So what do you think should be done, in the long run? I agree that we > should (and pretty much will have to) keep the old API around, but > internally, we should just use the new assumptions, so that we don't > have code duplication.
In the long run, I think the systems should be merged, by breaking up the old system and connecting its low-level parts to the new one. > > > > > In the new assumptions, there's no cache: things like ask(Q.prime(7)) > > are recomputed every time, contrarily to Integer(7).is_prime. > > Should this be changed? It seems like this would make things > inefficient if we used the new assumptions everywhere. > Yes, it would be rather inefficient, but this isn't the worst problem IIRC. The real pain point is that actual assumptions (i.e. Q.prime(n) as opposed to Q.prime(7)) are stored in a big set that must be inspected in full every time ask() is called. > And if so, should the cache be stored in a global dict, or inside the > objects themselves? Anyway, I guess this is a (probably) trivial > implementation detail that can be worked out once we start replacing > the old assumptions. A global cache would keep objects alive indefinitely, which might be a problem, even though the cache currently tends to do that anyway. -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
