#13764: CartesianProduct with generators -> silent wrong answer
---------------------------------+------------------------------------------
       Reporter:  vbraun         |         Owner:  sage-combinat
           Type:  defect         |        Status:  needs_info   
       Priority:  major          |     Milestone:  sage-5.6     
      Component:  combinatorics  |    Resolution:               
       Keywords:                 |   Work issues:               
Report Upstream:  N/A            |     Reviewers:               
        Authors:  Volker Braun   |     Merged in:               
   Dependencies:                 |      Stopgaps:               
---------------------------------+------------------------------------------
Changes (by ncohen):

  * status:  new => needs_info


Comment:

 Hellooooooo !!

 Well, same question as the one asked on sage-devel : why shouldn't we
 build the list of each iterator ? If the list is infinite then the code
 will not terminate, but of course the user asked for it, and if we do make
 lists from generators we store a quantity of information which is
 (expectedly) small compared to the output ?

 Err... Actually, if the function does not return a list but only "yields"
 the elements one at a time, what we store could actually be much, much
 more than what we should.

 Hence, what about doing this :
 * If we are given two lists, just do the job without problems
 * If we are given iterators, convert them to lists first then do the job ?

 With a `.. NOTE::` in the method's documentation, saying exactly that.
 This way we never use more than what we actually need to use.

 Nathann

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13764#comment:1>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to