+ 2

Why does Python not have a set indent to keep code consistent between different programmers?

20th Mar 2017, 9:06 PM
Bill Bufford
Bill Bufford - avatar
3 odpowiedzi
+ 10
To be honest I haven't seen a real, big code being indented by any other number of spaces than four. There are some scripts here on SoloLearn that have two spaces because of many nested loops and/or complex if statements. But other than that, none.
20th Mar 2017, 10:19 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 7
Oh, it does. Check PEP 8 for reference: https://www.python.org/dev/peps/pep-0008/
20th Mar 2017, 9:31 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
I know that the good practice way is to use 4 spaces. My question is why python doesn't insist on it. Thanks for the link though. Useful!
20th Mar 2017, 10:14 PM
Bill Bufford
Bill Bufford - avatar