#16269: Cartesian Products of additive groups
-------------------------------------+-------------------------------------
       Reporter:  ncohen             |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.2
      Component:  categories         |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Nathann Cohen,     |    Reviewers:
  Nicolas M. ThiƩry                  |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:  u/ncohen/16269     |  d22e245049e26dd10522d3514603868701a286fb
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by nthiery):

 Hi!

 I have just been through the changes. Overall, it looks good, thanks!

 Remaining points:
 - CartesianProduct.__iter__ should be in
 EnumeratedSets.CartesianProducts.ParentMethods
 - In ``_add_``, ``self.parent(right)`` looks suspicious. Does it even
 work?
   If the purpose is to convert ``right`` into the same parent as
   ``self``, then no need to worry about this: ``_add_`` may assume
   that its two arguments belong to the same parent.
 - I am uncomfortable with using ``__iter__`` and ``__getitem__`` for
   accessing the components of an element. For certain cartesian
   products (e.g. cartesian products of modules), ``__iter__`` may have
   a different meaning. Please use ``summand_split`` and
   ``summand_projection`` instead.
 - In ``_element_constructor_``: given the catch, if we feed completely
   unrelated crap to the constructor, is there an exception raised as
   one could desire?
 {{{
     sage: GF(3)("a")
     Traceback (most recent call last)
     ...
     TypeError: unable to convert x (=a) to an integer

     sage: C = cartesian_product([GF(3), GF(3)])
     sage: C(["a","b"])
     ???
 }}}


 Please add this doctest. Btw, one might also want to raise a meaningful
 error if the length of `x` is incorrect.

 Cheers,
                                         Nicolas

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