3 ms·
I would write: if the_result_of_this_function(on_this_arg) == 10 \ and this_overly_descriptive_boolean: do_stuff() Indenting the second line of the
by zephyrfalcon 16y ago
I would write:
if the_result_of_this_function(on_this_arg) == 10 \
and this_overly_descriptive_boolean:
do_stuff()
Indenting the second line of the if statement would, at first glance, indicate that it's part of the block instead. Then again, it depends. If it was the header of a def statement, I would follow the PEP, e.g.
def __init__(self, width, height,
color='black', emphasis=None, highlight=0):
On a side note, I once did the "Art & Logic challenge" [http://www.artlogic.com/ http://www.artlogic.com/] and they use guidelines that apply to several languages, e.g. you would use the same formatting style for C++ and for Python, if at all possible. Much of it flies in the face of PEP 8.