#10963: More functorial constructions
-------------------------------------+-------------------------------------
       Reporter:  nthiery            |        Owner:  stumpc5
           Type:  enhancement        |       Status:  needs_work
       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:  Detect and fix
  public/ticket/10963                |  Heisenbugs
   Dependencies:  #11224, #8327,     |       Commit:
  #10193, #12895, #14516, #14722,    |  8eaf51a82c4e2194769db13457979ae601ebbc04
  #13589, #14471, #15069, #15094,    |     Stopgaps:
  #11688, #13394, #15150, #15506     |
-------------------------------------+-------------------------------------

Comment (by SimonKing):

 Here is my attempt at explaining the interrelation of the cached function
 `base_category_class_and_axiom`, the `__classget__`, and the lazy
 attribute
 `_base_category_class_and_axiom`.

 - The lazy attribute needs the cached function to compute its value.
 - If the classget is invoked, then the value of the lazy attribute does
 not
   need to be guessed, but can be put explicitly (but then: Why is
   `cls._base_category_class_and_axiom_was_guessed = True`? It should be
 False,
   since the value is in fact ''not'' guessed by classget).
 - The cached function invokes the classget to do a consistency test.

 Now, it can obviously happen that everything starts by calling the lazy
 attribute. Then, classget is called, and overrides the lazy attribute
 ''before
 its computation is finished''. Then, the lazy attribute finishes its
 computation, and is overridden again (by the value it just computed).

 I guess this is why the lazy attribute / cached function is called twice
 for
 some classes, even with our fixes.

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