#13764: CartesianProduct with generators -> silent wrong answer
-----------------------------+----------------------------------------------
   Reporter:  vbraun         |             Owner:  sage-combinat
       Type:  defect         |            Status:  new          
   Priority:  major          |         Milestone:  sage-5.6     
  Component:  combinatorics  |          Keywords:               
Work issues:                 |   Report Upstream:  N/A          
  Reviewers:                 |           Authors:  Volker Braun 
  Merged in:                 |      Dependencies:               
   Stopgaps:                 |  
-----------------------------+----------------------------------------------
 This is actually documented in the docstring:
 {{{
 sage: def a(n): yield 1*n; yield 2*n
 sage: def b(): yield 'a'; yield 'b'
 sage: CartesianProduct(a(3), b()).list()
 [[3, 'a'], [3, 'b']]
 }}}
 But by the principle of minimal surprise this should yield an error about
 generators and not silently return the wrong answer. Just to illustrate
 how dangerous this behavior is note that `sage/combinat/integer_vector.py`
 falls precisely into this trap.

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