On Apr 18, 6:06 pm, Alex Ghitza <aghi...@gmail.com> wrote:
> Hi sage-devel,

Hi Alex,

> I'm slowly and painfully making my way through
> schemes/generic/morphism.py and have run into some trouble that
> persisted even after looking at rings/morphism.pyx which was recently
> doctested by William.
>
> So here are some questions:
>
> 1. sage -coverage asks for a doctest of the form s == loads(dumps(s)).
>  As far as I can tell however, it is happy if there is one such test
> in a file, even if the file happens to define 20 different classes.  I
> would assume that we want a doctest of this form for each class
> definition, is that right?  If so, can/should sage -coverage be
> changed to indicate this?

Yes, I think that is a bug and not having pickles of all classes will
cause trouble down the road. Please open a ticket.

> 2. at the moment, s == loads(dumps(s)) fails miserably for any of the
> classes in schemes/generic/morphism.py.  The problem is in the
> comparison, and the classes do not define __cmp__() methods.  I also
> noticed that the class they inherit from, Map, also does not implement
> its own __cmp__().  So the question is: am I right in assuming that I
> have to implement __cmp__() in my classes?  Would it be a good idea to
> also implement a generic __cmp__() for Map, or is there a good reason
> why this was left out?
>
> 3. as I mentioned, I looked in rings/morphism.pyx for inspiration;
> this helped, but not enough so I tried
> sage: f = ZZ.hom(QQ)
> sage: g = loads(dumps(f))
> sage: f == g
> False
>
> Shouldn't this return True?  Shouldn't a test like this be somewhere
> in rings/morphism.pyx?

I am not sure about the last two questions, so I will wait for someone
more knowledgeable to answer this.

> It would be great to know more about the issues involved here.  I'm
> really not familiar with this part of the Sage infrastructure and it
> shows :)

I think the various morphism classes are not the cleanest code in Sage
from what I have gathered. :)

> Best,
> Alex

Cheers,

Michael

> --
> Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne
> -- Australia --http://www.ms.unimelb.edu.au/~aghitza/
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to