#18361: CategoryObject: always cache gens_dict
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:
           Type:  enhancement        |       Status:  needs_info
       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|  
9154c9fd6f3d5df75e84e80cd2f1446909658915
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by jdemeyer):

 Replying to [comment:8 jdemeyer]:
 > If you prefer, I can move the whole `gens_dict()` method, but that's a
 more drastic change.
 That doesn't work:
 {{{
 sage -t src/sage/rings/polynomial/pbori.pyx
 **********************************************************************
 File "src/sage/rings/polynomial/pbori.pyx", line 4067, in
 sage.rings.polynomial.pbori.BooleanPolynomial.subs
 Failed example:
     f.subs(x=1)
 Exception raised:
     Traceback (most recent call last):
       File "/usr/local/src/sage-config/local/lib/python2.7/site-
 packages/sage/doctest/forker.py", line 496, in _run
         self.compile_and_execute(example, compiler, test.globs)
       File "/usr/local/src/sage-config/local/lib/python2.7/site-
 packages/sage/doctest/forker.py", line 858, in compile_and_execute
         exec(compiled, globs)
       File "<doctest
 sage.rings.polynomial.pbori.BooleanPolynomial.subs[2]>", line 1, in
 <module>
         f.subs(x=Integer(1))
       File "sage/rings/polynomial/pbori.pyx", line 4115, in
 sage.rings.polynomial.pbori.BooleanPolynomial.subs
 (build/cythonized/sage/rings/polynomial/pbori.cpp:32460)
         gdict = P._monom_monoid.gens_dict()
       File "sage/structure/parent.pyx", line 840, in
 sage.structure.parent.Parent.__getattr__
 (build/cythonized/sage/structure/parent.c:7903)
         attr = getattr_from_other_class(self, self._category.parent_class,
 name)
       File "sage/structure/misc.pyx", line 253, in
 sage.structure.misc.getattr_from_other_class
 (build/cythonized/sage/structure/misc.c:1583)
         raise dummy_attribute_error
     AttributeError: 'BooleanMonomialMonoid_with_category' object has no
 attribute 'gens_dict'
 **********************************************************************
 }}}

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