better 'splice' function
gyromagnetic
gyromagnetic at excite.com
Wed Jul 17 17:49:18 EDT 2002
Thanks John and Sean for the pointer. I guess I didn't follow that
particular thread.
My problem is slightly different in that instead of a mapping of a
single tuple to a value, I will have a list of tuples, and want to
enumerate all of the possibilities.
So, for your example posting
x = ( 'John', 'Hunter', 'where' )
map:
m = {
'where': [('was', 'here'),('was not', 'there')],
'somekey': 'someval'
}
I'd like
y = [('John', 'Hunter', 'was', 'here'),
('John', 'Hunter','was not', 'there')]
I'll take a look at the many clever solutions that were proposed and
try to modify them accordingly.
-Brad
John Hunter <jdhunter at nitace.bsd.uchicago.edu> wrote in message news:<m27kjuibw7.fsf at mother.paradise.lost>...
> >>>>> "Sean" == Sean 'Shaleh' Perry <shalehperry at attbi.com> writes:
>
> Sean> something A LOT like this was discussed within the last two
> Sean> months at length. Many, many, many implementations were
> Sean> presented. Have a search through the archives.
>
> Yep, check
>
> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&safe=off&frame=right&th=fb73946e707ff1da&seekm=mailman.1019594863.1719.python-list%40python.org#link1
>
> John Hunter
More information about the Python-list
mailing list