Re: [sage-support] Sage container class?

2012-03-21 Thread Emil
On 21 March 2012 23:21, Mike Hansen wrote: > A normal dictionary should work: Hi Mike, thanks! I see from a quick look at the source that, on non-SageObjects dumps() does: cPickle.dumps(obj, protocol=2) I am a bit confused about the relationship between the dumps/loads mechanism and pickling...

Re: [sage-support] Sage container class?

2012-03-21 Thread Mike Hansen
On Wed, Mar 21, 2012 at 4:17 PM, Emil wrote: > Alternatively, if I just make a dictionary of SageObjects and pickle, > would that work? Thanks, A normal dictionary should work: sage: loads(dumps(dict(a=2, b=random_matrix(ZZ, 4 {'a': 2, 'b': [ 0 -1 -2 0] [-2 1 -1 -1] [ 3 1 -1 1] [ 4 6 -1

[sage-support] Sage container class?

2012-03-21 Thread Emil
Hi, I was wondering if there is anything like a dictionary or container class, that inherits from SageObject, and to which I can add arbitrary SageObjects? I would like to be able to do something like: sage: D = SageDictionary() sage: D["matrix1"] = M sage: D["bound"] = x sage: s = D.dumps() The