You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since we recommend following PEP-8 in the guide we should do the same thing here.
Having a limited line length also encourages people to avoid code with a high complexity (e.g. deeply nested for loops and if statements) since it just doesn't fit on the line.
Personally I am a fan of a slightly longer line length, following the reasoning laid out here.
Especially with code for scientific purposes, slightly longer/more explicit function or variable names can make things more readable, and a longer line length makes it a bit easier to have longer names.
Even without nested loops, a single level loop in a class method starts 12 characters in already.
The exact PEP8 line length of 79 is just a legacy from IBM punch cards.
Some teams strongly prefer a longer line length. For code maintained exclusively or primarily by a team that can reach agreement on this issue, it is okay to increase the line length limit up to 99 characters, provided that comments and docstrings are still wrapped at 72 characters.
The point of this issue was that we recommend following the conventions in PEP-8 in the guide and that the template should reflect that, not to start a discussion on what the best line length is. Apparently, that is so controversial that even black does not dare to take a decision on it. Of course, everyone is free to change it to their own liking in their own projects, but the template should use the default.
Activity
egpbos commentedon May 14, 2024
I personally change this always to something like 120, so it may have been me who did this. I'm fine with changing the default, though.
BSchilperoort commentedon May 24, 2024
Personally I am a fan of a slightly longer line length, following the reasoning laid out here.
Especially with code for scientific purposes, slightly longer/more explicit function or variable names can make things more readable, and a longer line length makes it a bit easier to have longer names.
Even without nested loops, a single level loop in a class method starts 12 characters in already.
The exact PEP8 line length of 79 is just a legacy from IBM punch cards.
sjvrijn commentedon May 26, 2024
I'd be in favor of lines longer than 79 characters too.
The linked PEP8 section explicitly mentions 99 as a viable option:
bouweandela commentedon Jun 5, 2024
The point of this issue was that we recommend following the conventions in PEP-8 in the guide and that the template should reflect that, not to start a discussion on what the best line length is. Apparently, that is so controversial that even
blackdoes not dare to take a decision on it. Of course, everyone is free to change it to their own liking in their own projects, but the template should use the default.DaniBodor commentedon Jun 14, 2024
Maybe make it a question when setting up the cookiecutter and default it to the 79?