Hi,

I'm trying to insert a TestSuite(s).run() doctest in some code we're
polishing.  So far it helped me find a couple of bugs, so I'm quite
impressed with the whole concept.

Unfortunately, there is a test that I'm not yet able to fix, namely
_test_category for an element class we define.  Let me try to say what
the situation is without going into irrelevant details:

* we have a class Parent_class which inherits from Algebra
* we have a class Element_class which inherits from AlgebraElement

Say e is an instance of Element_class.  Running e._test_category() fails
in the following place:

   if not is_extension_type(self.__class__):
       # For usual Python classes, that should be done with
       # standard inheritance
       tester.assert_(isinstance(self, self.parent().category().element_class))

Here self.parent().category() is "Category of algebras over Integer
Ring" and self.parent().category().element_class is 
"<class 'sage.categories.algebras.Algebras.element_class'>".

What am I missing?  One would hope that an AlgebraElement is an instance
of the element class of an Algebra, but that doesn't seem to be the
case.


Best,
Alex


-- 
Alex Ghitza -- http://aghitza.org/
Lecturer in Mathematics -- The University of Melbourne -- Australia

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to