multiplication of lists of strings

castironpi at gmail.com castironpi at gmail.com
Tue Mar 4 22:50:56 EST 2008


On Mar 4, 9:46 pm, Jason Galyon <jas... at gmail.com> wrote:
> Gabriel Genellina wrote:
> > En Tue, 04 Mar 2008 23:50:49 -0200, Jason <jas... at gmail.com> escribió:
>
> >> How could I return a list or tuple of each unique combination of a given
> >> set of lists (perhaps from a dict or a list).  This means the number of
> >> lists are not known nor is the length of each.
>
> > Use the Google interfase for this group:
> >http://groups.google.com/group/comp.lang.python/
> > Type "unique combinations lists" in the text box; press "Search in this
> > group". The very first result contains some answers to your question.
>
> found it, the referenced cookbook recipe is perfect.
>
> Thanks, Gabriel

That reminds me:  Is there a generic 'relation' pattern/recipie, such
as finding a computer that's "paired" with multiple users, each of who
are "paired" with multiple computers, without maintaining dual-
associativity?

Good:

py> user.getcomputers()
[ Compie1, Compie2 ]

Bad:

user._computers.add( compieN )
compieN._users.add( user )

?



More information about the Python-list mailing list