[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

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

From: Neels J Hofmeyr <neels_at_elego.de>
Date: Thu, 01 Jul 2010 15:34:29 +0200

On 2010-06-30 08:53, Daniel Shahaf wrote:
> neels_at_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

Received on 2010-07-01 15:35:20 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.