#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 SimonKing):

 Hi Nicolas!

 Welcome back...

 Can you also please address my confusion about the following (see
 comment:535).
 {{{
 sage: Semigroups().Finite
 Cached version of <function Finite at 0xa4c2c6c>
 sage: Semigroups().__class__.Finite
 <class 'sage.categories.finite_semigroups.FiniteSemigroups'>
 }}}

 `Semigroups` has a class attribute called `"Finite"`, that is a lazily
 imported class `FiniteSemigroups`. Fine.

 The (unique) instance of `Semigroups` does, however, ''not'' inherit the
 attribute `"Finite"` from its class. Instead, it provides a cached method.
 Calling this cached method `Semigroups().Finite` does, however, just
 return an instance of `Semigroups.Finite`.

 The three questions are:
 1. ''Why'' is `Semigroups.Finite` overridden on instances of `Semigroups`?
 After all, calling `Semigroups.Finite()` returns the same thing as
 `Semigroups().Finite()` (and is cached as well).
 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__`.
 3. ''Where'' can the answers to 1. and 2. be found in the docs?

 Best regards,

 Simon

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