Anonymus functions revisited : tuple actions
bruno modulix
onurb at xiludom.gro
Wed Mar 23 05:12:19 EST 2005
Kay Schluehr wrote:
> Hi all,
>
> thanks for Your attention !
>
> I think my proposal was more in mind of Rons modified exec than
> Pythons lambda.
>
> When George proposed his unpacking behavoir for list-comps as a pack of
> suggar:
>
> 1. [x*y-z for (x,y,z=0) in (1,2,3), (4,5), (6,7,8)]
>
> I interpreted it in a subsequent posting in lambda fashion:
>
> 2. [(lambda x,y,z=0:x*y-z)(*v) for v in (1,2,3), (4,5), (6,7,8)]
Argh! Stupid me ! I never thought of using the star operator for this :(
Thanks Kay.
(snip)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"
More information about the Python-list
mailing list