#18361: CategoryObject: always cache gens_dict
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.7
      Component:  categories         |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jeroen Demeyer     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jdemeyer/categoryobject__always_cache_gens_dict|  
1b5fff6a230bbb54967046ef4c7a23d27e12d4ce
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Replying to [comment:14 jdemeyer]:
 > Would you prefer to remove the caching completely in `gens_dict()`?

 +1 to me. Building a dictionary is very fast. I had a quick look through
 the source code. And no functions relies on it for critical computations
 (mostly it is to build a polynomial from a string). Note that the fastest
 way I found to allocate a dictionary is through `dict.fromkeys`.

 Could you also remove the custom implementation in `PolynomialRing` as the
 following seems to work
 {{{
 sage: Parent.gens_dict(QQ['x'])
 {'x': x}
 sage: Parent.gens_dict(QQ['x,y'])
 {'x': x, 'y': y}
 }}}

 Vincent

--
Ticket URL: <http://trac.sagemath.org/ticket/18361#comment:15>
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/d/optout.

Reply via email to