#14214: Cythoned homsets
----------------------------------------------+-----------------------------
       Reporter:  SimonKing                   |         Owner:  tbd             
                 
           Type:  enhancement                 |        Status:  needs_work      
                 
       Priority:  major                       |     Milestone:  sage-5.10       
                 
      Component:  performance                 |    Resolution:                  
                 
       Keywords:  Hom, cython, cached method  |   Work issues:  How to store 
domain and codomain?
Report Upstream:  N/A                         |     Reviewers:                  
                 
        Authors:  Simon King                  |     Merged in:                  
                 
   Dependencies:  #14159, #12951, #13184      |      Stopgaps:                  
                 
----------------------------------------------+-----------------------------

Comment (by SimonKing):

 Apparently it is "new style versus old style classes:
 {{{
 sage: class Bla(object):
 ....:     @property
 ....:     def _domain(self):
 ....:         return 1
 ....:
 sage: b = Bla()
 sage: b._domain
 1
 sage: b._domain = 3
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)
 <ipython-input-25-355f52a2815c> in <module>()
 ----> 1 b._domain = Integer(3)

 AttributeError: can't set attribute
 sage: b.__dict__['_domain'] = 3
 sage: b._domain
 1
 }}}
 versus
 {{{
 sage: class Bla:
     @property
     def _domain(self):
         return 1
 ....:
 sage: b = Bla()
 sage: b.__dict__['_domain'] = 3
 sage: b._domain
 3
 }}}

 So, we are stuck.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14214#comment:39>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to