#14100: Make raising attribute errors faster
---------------------------+------------------------------------------------
   Reporter:  SimonKing    |             Owner:  tbd           
       Type:  enhancement  |            Status:  new           
   Priority:  major        |         Milestone:  sage-5.8      
  Component:  performance  |          Keywords:  AttributeError
Work issues:               |   Report Upstream:  N/A           
  Reviewers:               |           Authors:  SimonKing     
  Merged in:               |      Dependencies:                
   Stopgaps:               |  
---------------------------+------------------------------------------------
 At #11342, getattr on parents and elements became faster, among other
 tricks, by supplying a "lazy" error message
 `sage.structure.misc.AttributeErrorMessage`. Namely, creating the error
 message as a string, even as a ''lazy'' string, took too much time.

 Here, I suggest to go one step further: `sage.structure.misc`,
 `sage.structure.element` and `sage.structure.parent` should store a fixed
 instance of `AttributeError` whose error message is a fixed instance of
 `AttributeErrorMessage`. When raising an attribute error, one can then
 just change the previously created error message in-place and then raise
 the previously created `AttributeError`.

 Hence, the time for ''creating'' the attribute error is saved.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14100>
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