On Sun, 17 Apr 2022 at 07:37, Sam Ezeh <sam.z.e...@gmail.com> wrote: > > 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.
What about: [result.process(module, data) for module, data in jobs] (or with () instead of [] around the outside if you want a generator)? In general, if you're using map() with a lambda function, it's often simpler to switch to a comprehension. ChrisA -- https://mail.python.org/mailman/listinfo/python-list