[New-bugs-announce] [issue34339] Argument unpacking syntax for lambdas

danijar report at bugs.python.org
Sun Aug 5 12:37:04 EDT 2018

New submission from danijar <mail at danijar.com>:

It would be great to support argument unpacking for lambdas. Example:

  lambda x, (y, z): x + y + z

instead of

  lambda x, y_and_z: x + y_and_z[0] + y_and_z[1]

Similar unpacking syntax is available for normal functions:

  def foo(x, y_and_z):
    y, z = y_and_z
    return x + y + z

This would greatly increase readability in some cases.

components: Interpreter Core
messages: 323158
nosy: benjamin.peterson, brett.cannon, danijar, yselivanov
priority: normal
severity: normal
status: open
title: Argument unpacking syntax for lambdas

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list