-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use default line lenght of 79 characters #388
Comments
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. |
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. |
I'd be in favor of lines longer than 79 characters too. The linked PEP8 section explicitly mentions 99 as a viable option:
|
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 |
Maybe make it a question when setting up the cookiecutter and default it to the 79? |
For some reason, the generated package has a default line length of 120 characters instead of the 79 prescribed by PEP-8: https://peps.python.org/pep-0008/#maximum-line-length
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.
The text was updated successfully, but these errors were encountered: