[Python-Dev] list splicing

Fredrik Lundh fredrik at pythonware.com
Mon Sep 19 07:16:37 CEST 2005


Karl Chen wrote:

> Hi, has anybody considered adding something like this:
>     a = [1, 2]
>     [ 'x', *a, 'y']
>
> as syntactic sugar for
>     a = [1, 2]
>     [ 'x' ] + a + [ 'y' ].
>
> Notes:
> - This is a common operation

is it?

</F>





More information about the Python-Dev mailing list