On Sun, Apr 27, 2014 at 9:40 AM, Barry Warsaw <ba...@python.org> wrote:

> On Apr 26, 2014, at 12:33 AM, Janzert wrote:
>
> >So the one example under discussion is:
> >foo = long_function_name(
> >   var_one, var_two,
> >   var_three, var_four)
> >
> >and comes from http://legacy.python.org/dev/peps/pep-0008/#indentation
>

wow! just looked at that part of the PEP again, and that is a LOT of
options. Is it impossible to come to any consensus on this? And as it
happens, my favorite is not in there, though as far as I can tell not
forbidden:

foo = long_function_name(var_one,
                                          var_two,
                                          var_three,
                                          var_four)

That is, I find that if the argument list is too long for one line, then
splitting it out to only one argument per line is much more readable to me.
This becomes more important with default parameters:

foo = long_function_name(var_one,
                                          var_two=a_value,
                                          var_three=some_other_value,
                                          var_four=(a, tuple, of, values)
                                          )
as with more information in each argument, it's a lot more clear where one
starts and the other begins. And it provides a nice place for comments:

foo = long_function_name(var_one,
                                          var_two=a_value, # because
default doesn't frobnicate in this case
                                          var_three=some_other_value,
                                          var_four=(a, tuple, of, values)
                                          )


Anyway -- is there a point in trying to standardize this a bit more in
PEP8, or has that battle long since been fought and conceded ?

-Chris

-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

chris.bar...@noaa.gov
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to