Re: [sage-devel] dumps doesn't save immutability for Matrix_mod2_dense

2013-06-03 Thread Matthew Weippert
Done.

I hope this is helpful. Sage rocks and I really appreciate everyone's work!

Cheers,
Matthew

On Friday, May 31, 2013 5:59:56 AM UTC-4, Martin Albrecht wrote:
>
> Looks like a bug/oversight. Can you open a trac ticket? 
>
> On Thursday 30 May 2013, Matthew Weippert wrote: 
> > I think I found a bug in dumps for matrices over GF(2). The problem 
> > surfaced when I tried to save a set of such matrices, and the load 
> failed 
> > complaining that 
> > 
> > TypeError('mutable matrices are unhashable',) 
> > 
> > Simple example demonstrates the problem: 
> > 
> > z = zero_matrix(GF(2), 3) 
> > z.set_immutable() 
> > print z.is_immutable() 
> > zstr = z.dumps() 
> > z2 = loads(zstr) 
> > print z2.is_immutable() 
> > 
> > 
> > which (i think) causes an exception in this code: 
> > s = set() 
> > s.add(z) 
> > sstr = dumps(s) 
> > s2 = loads(sstr) 
> > 
> > Cheers, 
> > Matthew 
>
> Cheers, 
> Martin 
>
> -- 
> name: Martin Albrecht 
> _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6532AFB4 
> _otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF 
> _www: http://martinralbrecht.wordpress.com/ 
> _jab: martinr...@jabber.ccc.de  
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-devel] dumps doesn't save immutability for Matrix_mod2_dense

2013-05-31 Thread Martin Albrecht
Looks like a bug/oversight. Can you open a trac ticket?

On Thursday 30 May 2013, Matthew Weippert wrote:
> I think I found a bug in dumps for matrices over GF(2). The problem
> surfaced when I tried to save a set of such matrices, and the load failed
> complaining that
> 
> TypeError('mutable matrices are unhashable',)
> 
> Simple example demonstrates the problem:
> 
> z = zero_matrix(GF(2), 3)
> z.set_immutable()
> print z.is_immutable()
> zstr = z.dumps()
> z2 = loads(zstr)
> print z2.is_immutable()
> 
> 
> which (i think) causes an exception in this code:
> s = set()
> s.add(z)
> sstr = dumps(s)
> s2 = loads(sstr)
> 
> Cheers,
> Matthew

Cheers,
Martin

--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6532AFB4
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://martinralbrecht.wordpress.com/
_jab: martinralbre...@jabber.ccc.de


signature.asc
Description: This is a digitally signed message part.


[sage-devel] dumps doesn't save immutability for Matrix_mod2_dense

2013-05-30 Thread Matthew Weippert
I think I found a bug in dumps for matrices over GF(2). The problem surfaced 
when I tried to save a set of such matrices, and the load failed complaining 
that

TypeError('mutable matrices are unhashable',)

Simple example demonstrates the problem:

z = zero_matrix(GF(2), 3)
z.set_immutable()
print z.is_immutable()
zstr = z.dumps()
z2 = loads(zstr)
print z2.is_immutable()


which (i think) causes an exception in this code:
s = set()
s.add(z)
sstr = dumps(s)
s2 = loads(sstr)

Cheers,
Matthew

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.