#8389: Sage eats all memory trying to evaluate MatrixSpace(QQ, 2)['x']
------------------------------------+--------------------------
       Reporter:  mmezzarobba       |        Owner:  AlexGhitza
           Type:  defect            |       Status:  needs_info
       Priority:  minor             |    Milestone:  sage-6.1
      Component:  algebra           |   Resolution:
       Keywords:                    |    Merged in:
        Authors:  Michael Orlitzky  |    Reviewers:
Report Upstream:  N/A               |  Work issues:
         Branch:                    |       Commit:
   Dependencies:                    |     Stopgaps:
------------------------------------+--------------------------
Changes (by mmezzarobba):

 * cc: nthiery (added)


Comment:

 Replying to [comment:7 tscrim]:
 > However what I'm thinking as a solution is that any parent in the
 category of `Rings` should have a default `__getitem__` which checks for
 string/list input and returns a polynomial/power series ring resp.
 Thoughts?

 In principle, I agree. Unfortunately, matrix spaces currently do not use
 the category framework by default (one needs to call
 `M.full_category_initialisation()` first) for efficiency reasons. So the
 change you are suggesting would not solve the problem with matrix spaces
 by itself.

 And I'm honestly at lost as to how to use the category framework with
 fundamental, widely used parents.

 In our case, it would make sense (despite the issue with matrix rings) to
 move the definition of `__getitem__` that deals with polynomials rings and
 the like from `sage.structure.Rings` to
 `sage.category.rings.Rings.ParentMethods`. But many common rings do not
 descend from `Rings().parent_class`, so one would need a wrapper in one
 direction or the other. Since `Rings.ParentMethods` is supposedly the
 recommended place to add generic stuff for rings in the long run, it would
 be natural to move the implementation there and provide a compatibility
 wrapper in `Ring`. Except that `Ring` comes before `Rings.ParentMethods`
 in the MRO of (most?) rings that use both...

 (On the top of that, there is a hack in `Parent.__getitem__` that one
 needs to be careful not to break...)

--
Ticket URL: <http://trac.sagemath.org/ticket/8389#comment:9>
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/groups/opt_out.

Reply via email to