"Greg Ewing" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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' ].
>
> You can write that as
>
On Monday 19 September 2005 19:20, Raymond Hettinger wrote:
> It might have a chance of acceptance this time if the proponents stick
> with unpacking at the end: a,b,*c=sometup instead of a,*b,c=sometup.
> The latter has usually gotten shot down quickly, taking the former down
> with it.
Tr
[Fred L. Drake]
> Indeed, "star unpacking" has been brought up many times; I think it
would
> be
> really cool myself.
It might have a chance of acceptance this time if the proponents stick
with unpacking at the end: a,b,*c=sometup instead of a,*b,c=sometup.
The latter has usually gotten shot
On Monday 19 September 2005 16:36, Michael Chermside wrote:
> 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
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 comple
Gareth McCaughan <[EMAIL PROTECTED]> wrote:
> The problems with syntax are
>
> 1 It adds cognitive load.
> 2 It makes your code look like line noise.
> 3 It reduces options for future development.
> 4 It complicates the parser.
>
> I don't know about #4, but I suspect it (along with the
On Monday 2005-09-19 06:38, Josiah Carlson wrote:
> > > [ 'x', *a, 'y']
> > >
> > > as syntactic sugar for
> > >
> > > [ 'x' ] + a + [ 'y' ].
> > >
> > > Notes:
> > > - This is a common operation
> >
> > is it?
>
> Not in the code that I read/use. While "not all 3 line functions should
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote:
>
> 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
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' ].
You can write that as
a = [1, 2]
a[1:1] = a
Greg
___
Python-
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?
___
Python-De
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
- To me, the splicing form looks much better than the
concatenation form
- It can be implemented more ef
11 matches
Mail list logo