Depending on style in can be both.
+-- semantic
v
def something(with aligned,
list of,
parameters):
^
visual --+Depending on style in can be both.
+-- semantic
v
def something(with aligned,
list of,
parameters):
^
visual --+Example of what that does in practice: Lines that end up wrapping almost at the end of the soft-character-limit and look like this:
https://github.com/pennersr/django-allauth/blob/c9b31ddee81d...
If you're going to do that, the "correct" way would be to indent each parameter with tabs to the same depth as the function declaration, and then use spaces to take up the rest of the space (i.e. the width of the function declaration). Which is admittedly ugly - but it's ugly because it reflects the ugliness of misusing indentation for alignment. It's slightly less ugly if you use an editor that displays tabs and spaces differently - Kate/Kdevelop use a nice discreet » character for each level of indentation:
def hello_spam():
» while True:
» » print ("Hello",
» » "World")
The last line is visually aligned, but the semantic depth is the same. def hello_spam():
» while True:
» » print(
» » » "Hello",
» » » "World"
» » )(Whether visual alignment of this sort is desirable is a different question. If you want it then spaces are appropriate.)
PEP8 was only meant as a style guide for the python standard library. Although many have unfortunately taken it as a religious text.