#14681: dumps doesn't save immutability for Matrix_mod2_dense
--------------------------------+-------------------------------------------
Reporter: matthew.weippert | Owner: jason, was
Type: defect | Status: new
Priority: minor | Milestone: sage-5.10
Component: linear algebra | Keywords: immutable hashable matrix
GF(2)
Work issues: | Report Upstream: N/A
Reviewers: | Authors:
Merged in: | Dependencies:
Stopgaps: |
--------------------------------+-------------------------------------------
Dumps doesn't save immutability for matrices over GF(2).
Simple example:
{{{
z = zero_matrix(GF(2), 3)
z.set_immutable()
print z.is_immutable()
zstr = z.dumps()
z2 = loads(zstr)
print z2.is_immutable()
}}}
This affects saving matrices and in particular raises
{{{TypeError('mutable matrices are unhashable',)}}} when these matrices
are used in hashed collections (set/dict etc):
{{{
z = zero_matrix(GF(2), 3)
z.set_immutable()
s = set()
s.add(z)
sstr = dumps(s)
s2 = loads(sstr)
}}}
'''Work Around for saving:'''
Saving lists of matrices works just fine, so if you need to save a set or
dictionary, convert to/from a list on before/after save.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14681>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.