On Sat, 17 Apr 2010 14:22:30 +0200, Florent Hivert 
<florent.hiv...@univ-rouen.fr> wrote:
> > 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'>".
> 
> Can you give the mro of e (the instance of Element_class) and the one of
> parent.element_class ?

OK, here is what I've got: (you won't be able to reproduce it exactly
because SiegelModularFormsAlgebra is not in Sage yet)

sage: p = SiegelModularFormsAlgebra()
sage: e = p.0
sage: isinstance(e, p.category().element_class)
False
sage: pmro = p.category().element_class.__mro__
sage: emro = e.__mro__
sage: pmro == emro
True
sage: pmro
(<class 'sage.categories.algebras.Algebras.element_class'>, 
<class 'sage.categories.rings.Rings.element_class'>, 
<class 'sage.categories.rngs.Rngs.element_class'>, 
<class 'sage.categories.modules.Modules.element_class'>, 
<class 'sage.categories.bimodules.Bimodules.element_class'>, 
<class 'sage.categories.left_modules.LeftModules.element_class'>, 
<class 'sage.categories.right_modules.RightModules.element_class'>, 
<class 
'sage.categories.commutative_additive_groups.CommutativeAdditiveGroups.element_class'>,
 
<class 
'sage.categories.commutative_additive_monoids.CommutativeAdditiveMonoids.element_class'>,
 
<class 
'sage.categories.commutative_additive_semigroups.CommutativeAdditiveSemigroups.element_class'>,
 
<class 'sage.categories.monoids.Monoids.element_class'>, 
<class 'sage.categories.semigroups.Semigroups.element_class'>, 
<class 'sage.categories.sets_cat.Sets.element_class'>, 
<class 'sage.categories.objects.Objects.element_class'>, 
<type 'object'>)


Thanks,
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