#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:
  public/ticket/10963                |       Commit:
   Dependencies:  #11224, #8327,     |  bdefe0daeb7a4154a506f5ac69a064b6150f8de6
  #10193, #12895, #14516, #14722,    |     Stopgaps:
  #13589, #14471, #15069, #15094,    |
  #11688, #13394, #15150, #15506     |
-------------------------------------+-------------------------------------

Comment (by SimonKing):

 Replying to [comment:273 nbruin]:
 > That sounds like it's not going to work correctly if one is inheriting
 from a class that has a value for the attribute already.

 1. If I understand correctly, we are not supposed to subclass a category
 with axiom.
 2. If we ''do'' subclass a category with axiom, `hasattr(nested_cls,
 "_base_category_class_and_axiom")` would indeed return True when
 nested_cls is a subclass of something that has this attribute. However,
 this is in fact not what we want. We would rather want that the subclass
 has its own attribute. At least this is my guess what we ''would'' want,
 if we were to create a subclass (which we don't).

 > I don't think it's a good idea to move away from normal attribute lookup
 semantics in python.

 I think the normal attribute lookup semantics in python simply is the
 wrong tool here. Actually we don't need `hasattr` at all, since we know
 for sure that the class ''has'' the attribute (namely: lazy class
 attribute). What we want to know is: Is this lazy attribute computed or
 not? And hasattr can certainly not answer that question.

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