On Nov 30, 2006, at 10:19 PM, Robert Bradshaw wrote:

>>> On the other hand, if you create a large number of elements modulo
>>> one
>>> integer with the caching you won't run out of memory, whereas  
>>> without
>>> it you might very well run out.
>>
>> I'm not so sure about this. If you cache, then every IntegerMod is a
>> Python object containing a pointer that points to the cached object.
>> If you don't cache, then every IntegerMod is a Python object
>> containing a single machine word describing which element it is. Am I
>> missing something here? Have I been spending too long away from
>> python/pyrex?
>
> No, the way caching is working here is that arithmetic operations
> return the pre-created Python object as the result. E.g.
>
> sage: R = Integers(389)
> sage: R(2)+R(3) is R(1)+R(4)
> True

arrrgghhhh of course.....

while (1)
        assert(Python != C);

David


--~--~---------~--~----~------------~-------~--~----~
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/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to