Syntax for one-line "nonymous" functions in "declaration style"

Chris Angelico rosuav at gmail.com
Tue Apr 2 03:30:53 EDT 2019


On Tue, Apr 2, 2019 at 6:04 PM Ian Kelly <ian.g.kelly at gmail.com> wrote:
> > Note that
> >
> >     foo.bar = baz
> >
> > and
> >
> >     foo[bar] = baz
>
> I wrote "directly assigned to a variable", not to an attribute or an item.
> These are not part of the suggestion.

So what's the advantage over just using def?

ChrisA



More information about the Python-list mailing list