[Python-Dev] Tuple/list assignment question

Nick Coghlan ncoghlan at iinet.net.au
Thu Aug 5 05:33:02 CEST 2004


Greg Ewing wrote:
> I can't remember seeing any particular objection -- just
> a matter of inertia, I think (i.e. nice to have but not
> compelling enough to spur the BDFL to accept it).

This certainly summarises my reason for criticising it. It's application 
to a basic 'command parsing' scenario was a useful case I hadn't thought 
of, though:

 >>> commands = line.split() for line in commandFile.readlines()
 >>> for command, *args in commands do: func_table[command](*args)

However, the slicing based alternative is fairly readable, too and if 
the BDFL says the interpreter changes needed to support the feature are 
too drastic, I'm willing to believe him :)

Regards,
Nick.

-- 
Nick Coghlan               |  Eugene, Oregon
Email: ncoghlan at email.com  |             USA


More information about the Python-Dev mailing list