On 30 Apr., 19:26, "Aaron S. Meurer" <asmeu...@gmail.com> wrote:
> I don't think that would work if we have assumptions that are separate from 
> the objects themselves.  In other words, if the assumptions change, then the 
> hash would have to change.
>

Well the hashable_content method (or whatever it is called) could
query for any currently active assumptions and amalgamate them
somehow. Of course this gets fairly close to having the assumptions
inside the objects again.


> I think using __del__ is a bad idea.  See 
> http://docs.python.org/reference/datamodel.html?highlight=__del__#obj....  
> Basically, __del__ is *not* called when you do "del x".  First off, "del > x" 
> reduces the reference count of x by 1, whereas x.__del__ is only called if 
> the reference count reaches zero.  So if you do
>
> a = [x]
> del x
>
> x.__del__ won't be called, because there is still a reference to x in b.  
> Second, I think that __del__ is not guaranteed to happen immediately, but 
> only at the next garbage collection event > (I might be wrong here, though).  
> But I think that __del__ should only be used for cleanup magic that doesn't 
> happen automatically with the regular garbage collector.  Implementing a 
> feature like assumptions in it isn't what it was made for.

But isn't this exactly what we are doing? There is no problem with
having global assumptions about unused objects, other than that it is
inefficient. So essentially we are trying to teach the garbage
collector that objects referenced only by assumptions can be recycled.

> By the way, Ronan, Vinzent, Christian, and Tom, can you all add the ideas you 
> have mentioned here as ideas on that wiki page?

Will do.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to