Hi Christian, On Fri, May 20, 2011 at 10:10:37AM +0200, Christian Nassau wrote: > I would like to create a new category that's derived from > AlgebrasWithBasis, but I get an infinite recursion when I ask for the > CartesianProducts: > > Here's a simple example: > > class MyAlgebrasWithBasis(AlgebrasWithBasis): > def __init__(self,R): > AlgebrasWithBasis.__init__(self,R)
Is your intention to create a subcategory of AlgebrasWithBasis? That is a category whose objects are algebras with basis, possibly endowed with more structure? If yes, the idiom is: class AlgebrasWithBasis(Category_over_base_ring): @cached_method def super_categories(self): return [AlgebrasWithBasis(self.base_ring())] ... Otherwise, please describe precisely your use case to see what we should do with it (fix the issue, raise a better warning, ...). Note that at this point, the hierarchy of classes for categories is basically flat: Category - Sets - Semigroups - Fields - ... - Category_over_base_ring - Modules - Algebras - ... Best, Nicolas -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ -- 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