why brackets & commas in func calls can't be ommited? (maybe it could be PEP?)
steve at holdenweb.com
Thu Mar 22 19:20:42 CET 2007
Bart Willems wrote:
> dmitrey wrote:
>> 1st still is shorter by 1 char; considering majority of people use
>> space after comma & number of parameters can be big it yileds
>> foo bar baz bar2 bar3 bar4
>> foo(bar, baz, bar2, bar3, bar4)
> I think most readers already agree on the ambiguities part. Now, for the
> length of the code...
> I agree that in you example the first syntax yields a full /five/ spaces
> less than the second syntax. However, it ignores the fact that if you
> are creating functions with that many arguments, you are probably doing
> something wrong. Can't those arguments be provided as a list?
I'm in danger of getting short-tempered on c.l.py for the first time in
a long time. If you think that five arguments is an excessive number for
a function then you live in a world of toy programs.
> Let's see what is shorter:
> foo bar baz bar2 bar3 bar4
> foo *bars
> Not to mention that it might (or might not) be a good idea to wrap the
> function in some kind of class where you can specify a whole bunch of
> attributes, so that you do not have to call a function with that many
> arguments to start with.
Right, I think I have to assume that you're taking the piss.
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
Recent Ramblings http://holdenweb.blogspot.com
More information about the Python-list