What's the accepted style in Python to format multiple lines of code that are method calls?
my_obj.call(x,y).multiple(*args).methods([1,2,3])
With implicit line breaks after brackets/parentheses it would look like this:
my_obj.call(
x, y).multiple(
*args).methods(
[1,2,3])
Which is a bit ugly and doesn't really fit with typical Python style.
Is it acceptable to format multiple method calls with the back slash
\
?my_obj.call(x, y) \ .multiple(*args) \ .methods([1,2,3])
If it is acceptable, is it then also acceptable to use two spaces in the line after for the method call or should there be no indentation?
.
) – Shelley