Pythonification of the asterisk-based collection packing/unpacking syntax
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Tue Dec 27 18:07:23 EST 2011
On Mon, 26 Dec 2011 13:51:50 -0800, Eelco wrote:
[...]
>> If your point is that parens are used more often than
>> packing/unpacking, that's almost certainly true, since function calls
>> (including method invocations) are so prevalent in pretty much any
>> code. But what does that prove?
>
> That proves the original point of contention: that the below* is
> suboptimal language design,
Well duh.
I was mocking the idea that the meaning of * is context-dependent is a
bad thing by pointing out that we accept context-dependent meaning for
round brackets () without any difficulties. Of course it is "suboptimal
language design" -- it couldn't fail to be. Context-dependency is not
necessarily a bad thing.
> not because terseness always trumps
> verbosity, but because commonly-used constructs (such as parenthesis or
> round brackets or whatever you wish to call them)
Parentheses are not a construct. They are symbols (punctuation marks)
which are applied to at least three different constructs: grouping,
function calls, class inheritance lists.
> are more deserving of
> the limited space in both the ascii table and your reflexive memory,
> than uncommonly used ones.
Right. And since sequence packing and unpacking is a common idiom, it
deserves to be given punctuation. That's my opinion.
--
Steven
More information about the Python-list
mailing list