#16836: __neg__ fails in CartesianProduct of CombinatorialFreeModule
--------------------------+----------------------------
   Reporter:  cnassau     |            Owner:
       Type:  defect      |           Status:  new
   Priority:  major       |        Milestone:  sage-6.4
  Component:  categories  |         Keywords:
  Merged in:              |          Authors:
  Reviewers:              |  Report Upstream:  N/A
Work issues:              |           Branch:
     Commit:              |     Dependencies:
   Stopgaps:              |
--------------------------+----------------------------
 {{{
 sage: X=CombinatorialFreeModule(ZZ,ZZ)
 sage: Y=cartesian_product((X,X))
 sage: -Y.an_element()
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 <ipython-input-11-189fa298bf84> in <module>()
 ----> 1 -Y.an_element()

 /waste/cn/sage-git/local/lib/python2.7/site-
 packages/sage/categories/additive_magmas.pyc in __neg__(self)
     920                     """
     921                     return self.parent()(
 --> 922                         -x for x in self.cartesian_factors())
     923
     924         class Algebras(AlgebrasCategory):

 /waste/cn/sage-git/local/lib/python2.7/site-
 packages/sage/structure/parent.so in sage.structure.parent.Parent.__call__
 (build/cythonized/sage/structure/parent.c:8902)()

 /waste/cn/sage-git/local/lib/python2.7/site-
 packages/sage/structure/coerce_maps.so in
 sage.structure.coerce_maps.DefaultConvertMap_unique._call_
 (build/cythonized/sage/structure/coerce_maps.c:4203)()

 /waste/cn/sage-git/local/lib/python2.7/site-
 packages/sage/structure/coerce_maps.so in
 sage.structure.coerce_maps.DefaultConvertMap_unique._call_
 (build/cythonized/sage/structure/coerce_maps.c:4110)()

 /waste/cn/sage-git/local/lib/python2.7/site-
 packages/sage/combinat/free_module.pyc in _element_constructor_(self, x)
    1527                 except TypeError:
    1528                     pass
 -> 1529             raise TypeError("do not know how to make x (= %s) an
 element of self (=%s)"%(x,self))
    1530
    1531     def _an_element_impl(self):

 TypeError: do not know how to make x (= <generator object <genexpr> at
 0x7fd385148050>) an element of self (=Free module generated by Integer
 Ring over Integer Ring (+) Free module generated by Integer Ring over
 Integer Ring)
 }}}

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