#10963: More functorial constructions
-------------------------------------+-------------------------------------
       Reporter:  nthiery            |        Owner:  stumpc5
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.1
      Component:  categories         |   Resolution:
       Keywords:  days54             |    Merged in:
        Authors:  Nicolas M. Thiéry  |    Reviewers:  Simon King, Frédéric
Report Upstream:  N/A                |  Chapoton
         Branch:                     |  Work issues:
  public/ticket/10963                |       Commit:
   Dependencies:  #11224, #8327,     |  eb7b486c6fecac296052f980788e15e2ad1b59e4
  #10193, #12895, #14516, #14722,    |     Stopgaps:
  #13589, #14471, #15069, #15094,    |
  #11688, #13394, #15150, #15506     |
-------------------------------------+-------------------------------------

Comment (by vbraun):

 Replying to [comment:485 nthiery]:
 > What I meant however is that, at the level of categories, the
 > "super-category" relation should not be modeled by inheritance.

 Must not, should not, need not? I agree, of course, that the category-
 relationship is unrelated to the object-relationship. But if its
 convenient to define your category by object-inheriting from another
 category, then why not?

 I would prefer to treat axioms as independent from categories (i.e. they
 don't inherit from Category). That then also gives you a non-category
 object that you can use to represent the axiom. Now, since you always have
 to create (manually or dynamically) a new class for a category-with-axiom
 it might just as well inherit from the axiom class(es). Though if you
 think its confusing then I'm also open to using a special class attribute
 and composition.

 Now for something different. For the super categories, is the following
 what we really want? Its good enough for figuring out the methods, but
 does contradict the `super_category` documentation:
 {{{#!python
 class Base(Category_singleton):
     def super_categories(self):
         return [Objects()]

     class SubcategoryMethods:
         A = axiom("A")
         B = axiom("B")
         C = axiom("C")

     class A(CategoryWithAxiom):
         pass
     class B(CategoryWithAxiom):
         pass
     class C(CategoryWithAxiom):
         pass

 Base().A()     in Base.A().B().C().super_categories()     # True, even
 though not direct supercategory
 Base().A().B() in Base.A().B().C().super_categories()     # False
 Base().A().B() in Base.A().B().C().all_super_categories() # False
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/10963#comment:486>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to