Tuple unpacking inside lambda expressions
Sam Ezeh
sam.z.ezeh at gmail.com
Wed Apr 20 06:59:12 EDT 2022
This also works great!
Kind Regards,
Sam Ezeh
On Tue, 19 Apr 2022 at 12:03, Antoon Pardon <antoon.pardon at vub.be> wrote:
>
> Op 16/04/2022 om 23:36 schreef Sam Ezeh:
> > Two questions here.
> >
> > Firstly, does anybody know of existing discussions (e.g. on here or on
> > python-ideas) relating to unpacking inside lambda expressions?
> >
> > I found myself wanting to write the following.
> >
> > ```
> > map(
> > lambda (module, data): result.process(module, data),
> > jobs
> > )
> > ```
> > However, it's of course not legal Python syntax.
>
> Why not write:
>
> itertools.starmap(result.process, jobs)
>
> --
> https://mail.python.org/mailman/listinfo/python-list
More information about the Python-list
mailing list