#18361: CategoryObject: always cache gens_dict
---------------------------+----------------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.7
Component: categories | Keywords:
Merged in: | Authors: Jeroen Demeyer
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
---------------------------+----------------------------------
The `cdef class CategoryObject` has this strange method:
{{{
def gens_dict(self):
r"""
Return a dictionary whose entries are
``{var_name:variable,...}``.
"""
if HAS_DICTIONARY(self):
try:
if self._gens_dict is not None:
return self._gens_dict
except AttributeError:
pass
v = {}
for x in self.gens():
v[str(x)] = x
if HAS_DICTIONARY(self):
self._gens_dict = v
return v
}}}
which provides caching only for Python subclasses. This should be a Cython
attribute instead.
--
Ticket URL: <http://trac.sagemath.org/ticket/18361>
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.