#10963: More functorial constructions
-------------------------------------+-------------------------------------
       Reporter:  nthiery            |        Owner:  stumpc5
           Type:  enhancement        |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-6.2
      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-doc-           |       Commit:
  distributive                       |  f1b6804c499bfdc9cd8a864f81f739d80783122d
   Dependencies:  #11224, #8327,     |     Stopgaps:
  #10193, #12895, #14516, #14722,    |
  #13589, #14471, #15069, #15094,    |
  #11688, #13394, #15150, #15506,    |
  #15757, #15759                     |
-------------------------------------+-------------------------------------

Comment (by nthiery):

 Replying to [comment:548 SimonKing]:
 > Can you also please address my confusion about the following (see
 comment:535).

 Oops, thanks for the reminder.

 > The three questions are:
 > 1. ''Why'' is `Semigroups.Finite` overridden on instances of
 `Semigroups`?

 So that, when {{{C}}} is a category, {{{C.Finite}}} always points to
 the original {{{Finite}}} method, whether C implements or not this
 axiom (an implementation detail). In particular, introspection with
 {{{C.Finite?}}} always nicely gives the documentation of the axiom
 from the {{{Finite}}} method.

 > 2. ''How'' is `Semigroups.Finite` overridden on instances of
 `Semigroups`? I simply don't see at what point the cached method is put
 into `Semigroups().__dict__`.

 That's implemented in `CategoryWithAxiom.__classget__`.

 > 3. ''Where'' can the answers to 1. and 2. be found in the docs?

 See, in the category_with_axiom file, the notes in the section "Simple
 case involving a single predefined axiom", the section "Defining a new
 axiom" and the documentation of `CategoryWithAxiom.__classget__`.

 I just spent some time refactoring those pieces of documentation with
 your specific questions in mind. I hope it's better now!

 Commit to come in a couple minutes when I'll have finished recompiling
 Sage and tested my changes ...

 > After all, calling `Semigroups.Finite()` returns the same thing as
 `Semigroups().Finite()` (and is cached as well).

 Indeed the overriding of `Semigroups().Finite` would not be absolutely
 necessary if we only cared about `Semigroups().Finite()` working, and not
 about introspection as above.

 Still `Semigroups.Finite()` kind of works by "fluke" at
 this point. I am not sure we want to support this syntax in the long
 run.  See also the section "Making the category with axiom directly
 callable".

 Cheers,
                                 Nicolas

--
Ticket URL: <http://trac.sagemath.org/ticket/10963#comment:549>
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