Need help...

Patrick W quitelikely at yahoo.com.au
Mon May 6 04:18:49 EDT 2002


Patrick W <quitelikely at yahoo.com.au> writes:

> shagshag13 at yahoo.fr (Shagshag) writes:
> 
> > Hello
> > 
> > (sorry for my poor english)
> > 
> > I need to build some kind of python object(s) which could handle these
> > :
> > 
> > having three keys a, b, c i have to define all possible "couples keys"
> > 
> > (a, b) -> v1 -> v2
> > (a, c) -> v3 -> v5 -> v8
> > (b, c) -> v1 -> v4
> > (a, b, c) -> v2 -> v4 -> v7
> > 
> > where -> stand for something like a linked list.
> > and i must be able to retrieve (a, b) with (b, a), (a, c) with (c, a)
> > and (a, b, c) with (a, c, b), (c, a, b), (b, a, c) or any combination
> > of the three...
> > i can have couples of 2, 3, 4, or more keys...
> 
> Hmmm. Not quite sure what you're looking for, but it seems that at
> least *part* of the solution requires a 'permutations' function ...

Oops. I think I misunderstood your intent. If these are lookup keys
for items in a dictionary of some sort, you definitely *don't* want to
enter all permutations. ;-)

Sorry.





More information about the Python-list mailing list