-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Maximum Line Length #434
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
Comments
#299 You seem to like this number 😉 |
I like this number because it is prescribed by the style guide we conform to. I don't see a reason to override this standard. |
We only |
I didn't know the IBM punchcard was the origin for the 80 character limit - thanks for sharing! This StackOverflow answer resonates with me:
Also the Google Style Guide also uses an 80 character limit. |
Most of the arguments for the limit of 80 are totally esoteric ... but just working with Note: I generated a preview #438 def test_multiple_files_several_matches_print_line_numbers_flag(self):
self.assertMultiLineEqual(
grep("that", ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"], "-n"),
("midsummer-night.txt:5:But I beseech your grace that I may know\n"
"midsummer-night.txt:6:The worst that may befall me in this case,\n"
"paradise-lost.txt:2:Of that Forbidden Tree, whose mortal tast\n"
"paradise-lost.txt:6:Sing Heav'nly Muse, that on the secret top\n")
)
def test_multiple_files_several_matches_case_insensitive_flag(self):
self.assertMultiLineEqual(
grep("TO", ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"], "-i"),
("iliad.txt:Caused to Achaia's host, sent many a soul\n"
"iliad.txt:Illustrious into Ades premature,\n"
"iliad.txt:And Heroes gave (so stood the will of Jove)\n"
"iliad.txt:To dogs and to all ravening fowls a prey,\n"
"midsummer-night.txt:I do entreat your grace to pardon me.\n"
"midsummer-night.txt:In such a presence here to plead my thoughts;\n"
"midsummer-night.txt:If I refuse to wed Demetrius.\n"
"paradise-lost.txt:Brought Death into the World, and all our woe,\n"
"paradise-lost.txt:Restore us, and regain the blissful Seat,\n"
"paradise-lost.txt:Sing Heav'nly Muse, that on the secret top\n")
) def test_multiple_files_several_matches_print_line_numbers_flag(self):
self.assertMultiLineEqual(
grep("that",
["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
"-n"),
("midsummer-night.txt:5:But I beseech your grace that I may know\n"
"midsummer-night.txt:6:The worst that may befall me in this case,"
"\nparadise-lost.txt:2:Of that Forbidden Tree, whose mortal tast"
"\nparadise-lost.txt:6:Sing Heav'nly Muse, that on the secret top"
"\n"
))
def test_multiple_files_several_matches_case_insensitive_flag(self):
self.assertMultiLineEqual(
grep("TO",
["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
"-i"),
("iliad.txt:Caused to Achaia's host, sent many a soul\n"
"iliad.txt:Illustrious into Ades premature,\n"
"iliad.txt:And Heroes gave (so stood the will of Jove)\n"
"iliad.txt:To dogs and to all ravening fowls a prey,\n"
"midsummer-night.txt:I do entreat your grace to pardon me.\n"
"midsummer-night.txt:In such a presence here to plead my thoughts"
";\nmidsummer-night.txt:If I refuse to wed Demetrius.\n"
"paradise-lost.txt:Brought Death into the World, and all our woe,"
"\nparadise-lost.txt:Restore us, and regain the blissful Seat,\n"
"paradise-lost.txt:Sing Heav'nly Muse, that on the secret top\n")) That's why I like a soft limit instead. Always try to get below 79 and only in some rare cases cross it if it helps readability but never over 99. |
Awesome! I feel strongly that this is the case. |
The Code Style section states:
PEP8 states:
However we encourage developers to check code style with:
Why do we use a max-line-length of 99 characters instead of 79 characters?
The text was updated successfully, but these errors were encountered: