Opened 5 years ago

#21133 new defect

Pickling of module morphisms with cached methods doesn't return an equal morphism

Reported by: tscrim Owned by:
Priority: major Milestone: sage-7.3
Component: pickling Keywords: module morphism
Cc: sage-combinat, nthiery, darij Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

We have the following:

sage: L = posets.BooleanLattice(4)
sage: M = L.moebius_algebra(QQ)
sage: E = M.E()
sage: I = M.I()
sage: phi = E.coerce_map_from(I)
sage: psi = loads(dumps(phi))
sage: phi.__dict__
{'_dominant_item': *.trailing_item(key=<bound method MoebiusAlgebra.I_with_category._key of Moebius algebra of Finite lattice containing 16 elements over Rational Field in the idempotent basis>),
 '_inverse': None,
 '_inverse_on_support': <built-in function identity>,
 '_invertible': True,
 '_is_module_with_basis_over_same_base_ring': True,
 '_key_kwds': {'key': <bound method MoebiusAlgebra.I_with_category._key of Moebius algebra of Finite lattice containing 16 elements over Rational Field in the idempotent basis>},
 '_on_basis': Cached version of <function _to_natural_basis at 0x7fd4a534a758>,
 '_position': 0,
 '_triangular': 'lower',
 '_unitriangular': True,
 '_zero': 0}
sage: psi.__dict__
{'_dominant_item': *.trailing_item(key=<bound method ?._key of Moebius algebra of Finite lattice containing 16 elements over Rational Field in the idempotent basis>),
 '_inverse': None,
 '_inverse_on_support': <built-in function identity>,
 '_invertible': True,
 '_is_module_with_basis_over_same_base_ring': True,
 '_key_kwds': {'key': <bound method ?._key of Moebius algebra of Finite lattice containing 16 elements over Rational Field in the idempotent basis>},
 '_on_basis': Pickle of the cached method "_to_natural_basis",
 '_position': 0,
 '_triangular': 'lower',
 '_unitriangular': True,
 '_zero': 0}
sage: psi.__dict__['_on_basis'] == phi.__dict__['_on_basis']
False

(Note the _key_kwds is from #21122, but irrelevent for this bug.)

Change History (0)

Note: See TracTickets for help on using tickets.