Abe Dillon <abedil...@gmail.com> writes:

> A better way to list arguments is only one indentation level above the
> current:
>
> variable = some_class.method(
>     argument=value,
>     argument2=value)
>
> Trying to match the indentation of the opening line is less readable and
> less robust to refactoring:
>
> variable = some_class.method(argument=value,
>                              argument2=value)
>
> var = cls.method(argument=value,
>                              argument2=value)

Yes, that's unfortunate, but I still prefer the latter, and usually I accept
the hassle and realign the remaining lines.

In hindsight, I wish someone with a powerful time machine could introduce the
concept of "one-indent-level-and-half" for continuation lines: the statement
that most annoys me is the "if" when the condition is very long, because my
eyes suffer when I see the following:

  if condition1 and \
      condition2 and \
      condition3:
      do_something()

or even

  if (condition1 and
      condition2 and
      condition3):
      do_something()

at the point that I usually use a double paren just to have one single space
of difference between the continued condition elements and the succeeding
suite:

  if ((condition1
       and condition2
       and condition3)):
      do_something()

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  |                 -- Fortunato Depero, 1929.

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to