3 ms·
Not quite... http://legacy.python.org/dev/peps/pep-0008/#tabs-or-spaces http://legacy.python.org/dev/peps/pep-0008/#tabs-or-spaces Spaces are the preferred in
by jahnu 12y ago
Not quite...
http://legacy.python.org/dev/peps/pep-0008/#tabs-or-spaces http://legacy.python.org/dev/peps/pep-0008/#tabs-or-spaces
Spaces are the preferred indentation method.
Tabs should be used solely to remain consistent with code that is already indented with tabs.
Python 3 disallows mixing the use of tabs and spaces for indentation.
Python 2 code indented with a mixture of tabs and spaces should be converted to using spaces exclusively.
When invoking the Python 2 command line interpreter with the -t option, it issues warnings about code that illegally mixes tabs and spaces. When using -tt these warnings become errors. These options are highly recommended!
- ayrx 12y agoPEP 8 was published in 2001, a good 13 years ago. That's about as standard as you can get.