[Python-Dev] Re: syntactic shortcut - unpack to variably sizedlist

Nick Coghlan ncoghlan at iinet.net.au
Sat Nov 20 19:20:24 CET 2004


Raymond Hettinger wrote:
>>Officially killing that syntax was actually one of the stated goals of
> 
> the
> 
>>PEP.
> 
> I don't think that is a worthy goal.  The is some merit to the a,b,*c
> syntax.  When the time is ripe, it should have its day in court.

There's currently 3 things in the PEP draft:
1. Allow slice objects as arguments list.pop and array.pop
2. Add itertools.iunpack
3. Record the rejection of a, b, *c = L in a PEP (since it's been rejected three 
times now - once in 2001, and twice this year)

The first of those could probably be done without a PEP (given that a strict 
reading of the documentation suggests that those methods *should* handle slices)

The 2nd can certainly be separated out. Since I now know that, for actual 
iterators (rather than iterables), islice(n) will usually consume the first n 
elements, it loses some of its appeal (i.e. islice already has most of the 
features I like about iunpack).

The 3rd - well, I thought Guido's rejection in August suggested his position was 
unlikely to change (the AST branch going in for 2.5 doesn't seem to be 
significant enough to prompt a change of heart, and I can't think of anything 
else likely to affect his stated reasons for rejection).

I have no great problem with leaving the a, b, *c = L idea unPEPed if there is 
interest in leaving the idea 'open', though.

Cheers,
Nick.

-- 
Nick Coghlan               |     Brisbane, Australia
Email: ncoghlan at email.com  | Mobile: +61 409 573 268


More information about the Python-Dev mailing list