On Sun, 19 Jan, 2020, 11:35 Inada Naoki, <[email protected]> wrote:

> On Sun, Jan 19, 2020 at 2:45 PM Siddharth Prajosh <[email protected]>
> wrote:
> >
> > Moreover, shouldn't it work?
> > How do I add that feature in Python?
>
> How you can do it with warus operator.
>
> >>> (xs := list(range(10))).append(42)
> >>> xs
> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 42]
>

Great. This should do the trick! Thanks :-)

>
> Regards,
>
> --
> Inada Naoki  <[email protected]>
>
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/S5YBMGF3PN3GPZFSSGTGIXNQ5UH5KBFG/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to