A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-September/056502.html below:

[Python-Dev] list splicing

[Python-Dev] list splicingMichael Chermside mcherm at mcherm.com
Mon Sep 19 22:36:59 CEST 2005
Karl Chen writes:
> Hi, has anybody considered adding something like this:
>     a = [1, 2]
>     [ 'x', *a, 'y']
>
> as syntactic sugar for
>     a = [1, 2]
>     [ 'x' ] + a + [ 'y' ].

A bit later in the thread, Josiah Carlson replies:
> I don't think the parser would get measureably more complex, but I
> believe that any work to support this uncommon (from my experience)
> operation, rather than the dozens of other usable RFEs in the tracker,
> would be misspent time.

I'd just like to point out that this is a FRF (Frequently Requested
Feature). I'm not arguing in favor of it, just pointing out that
using "star unpacking" in tuple and list literals is an idea that
I'm sure I've seen proposed at least a couple of times before.

This doesn't necessarily make it a good idea, nor a bad one.

-- Michael Chermside

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4