You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Neels J Hofmeyr <ne...@elego.de> on 2010/07/01 13:34:29 UTC

Re: svn commit: r959090 - in /subversion/trunk/subversion/tests/manual: ./ README permutations.py tree-conflicts-add-vs-add.py

On 2010-06-30 08:53, Daniel Shahaf wrote:
> neels@apache.org wrote on Tue, 29 Jun 2010 at 23:22 -0000:
>> +  p = Permutations(('A', 'B'), (1, 2, 3), ('-',), (x, y))
>> +  print "All items:"
>> +  while p.next():
>> +    print p.row
> 
> Does this duplicate the functionality of itertools.product()?
> 
> http://docs.python.org/library/itertools.html?highlight=cartesian

indeed. I asked #python cause it's a bit hard to understand the itertools
help page. And it seems product() does exactly what I want.

list( itertools.product( (1,2), (a,b,c), (x,y) ) )

thanks!
~Neels