#13982: rewrite sage.combinat.combinat.unordered_tuples using
itertools.combinations_with_replacement
-----------------------------+----------------------------------------------
   Reporter:  nbruin         |             Owner:  sage-combinat
       Type:  enhancement    |            Status:  new          
   Priority:  minor          |         Milestone:  sage-5.7     
  Component:  combinatorics  |          Keywords:               
Work issues:                 |   Report Upstream:  N/A          
  Reviewers:                 |           Authors:               
  Merged in:                 |      Dependencies:               
   Stopgaps:                 |  
-----------------------------+----------------------------------------------
 With Python 2.7 there's a native implementation in python's itertools:
 {{{
 sage: list(itertools.combinations_with_replacement([1,2,3,4],2))
 [(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4),
 (4, 4)]
 sage: sage.combinat.combinat.unordered_tuples([1,2,3,4],2)
 [[1, 1], [1, 2], [1, 3], [1, 4], [2, 2], [2, 3], [2, 4], [3, 3], [3, 4],
 [4, 4]]
 }}}
 Given that the current doc of `unordered_tuples` mentions that it wraps a
 GAP routine and that this is undesirable, replacing it (or deprecating
 it!) may be a good idea.

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