Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Parentmethods for subcategories obtained from Functorial Constructions

In a related question to

https://ask.sagemath.org/question/48756/do-covariant-constructions-commute-with-withbasis/

I have a category Cs which implements the axiom FinitelyGeneratedAsCs. I want to define parent methods for graded objects of Cs. Some of these apply for all objects, some only for the finitely generated ones. If I have a design sketched as


class Cs(Category_over_base_ring):

    class Subcategorymethods:
        def Graded(self):
               return GradedModules.category_of(self)
         def FinitelyGenerate(self):
                return self._with_axiom("FinitelyGeneratedAsCs")

     class Graded(GradedModulesCategory):
             class ParentMethods:
                     def some_method_for_all_parents(self)

     class FinitelyGeneratedAsCs(CategoryWithAxiom_over_base_ring):
            class Graded(GradedModulesCategory):
                     class ParentMethods:
                             def some_method_only_for_fg_graded_parents(self):

Then I receceive

sage: Cs(QQ).FinitelyGenerated().Graded()
TypeError: Graded() takes exactly 1 argument (2 given)

If I however implement Graded as an axiom, say FakeGraded then I can set up parent methods as described above (just need to add a call to self._with_axiom('FakeGraded') in the appropriate place. I thought however that to have better integration with other parts of Sage I should implement Graded as the functorial construction in GradedModulesCategory but I'm hitting the above error.