On Fri, Oct 07, 2011 at 01:30:49PM -0700, Simon King wrote:
> I really don't see the problem.
> 
> On 7 Okt., 22:21, Simon King <simon.k...@uni-jena.de> wrote:
> > So, why shouldn't parent_class rely on the generic pickling of a
> > dynamic class? Well, I guess I should simply try and look how it blows
> > up...
> 
> I simply dropped the reduction data from the definition of a
> parent_class and element_class. Sage started, and now I get
> 
>   sage: Algebras(GF(3)).parent_class is Algebras(GF(5)).parent_class
>   True
>   sage: loads(dumps(Algebras(GF(3)).parent_class)) is
> Algebras(GF(5)).parent_class
>   True
>   sage: Algebras(GF(3)).parent_class is Algebras(ZZ).parent_class
>   False
> 
> There is a "todo" mentioned shortly below line 240 in category.py.
> That would be fixed as well:
>   sage: Coalgebras(QQ).parent_class is
> Coalgebras(FractionField(QQ[x])).parent_class
>   True
> 
> So, it seems that it just works. How did the pickling problem occur?

It would not be quite surprising if the pickling of classes made some
progress since 2009 :-) However, just to make sure: please save the
pickle to a file, and reload it in a fresh Sage session.

That being said, this way of pickling still has an issue: it exposes
the hierarchy of classes instead of encapsulating it. Hence, if one
later updates the hierarchy of categories (say by inserting an
intermediate category, or adding a ParentMethods class that did not
exist before), the hierarchy that will be recreated from an old pickle
won't coincide with the new one. This is likely to become more and
more a problem as more advanced category hierarchies are built through
constructions.

Cheers,
                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

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

Reply via email to