The following forum message was posted by at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/3778158:
As a newbie, my problem is I started out coding with a mixture of space and tab indents and rapidly evolving coding styles. The Eclipse [b]Source->Format Code[/b] is nice but the resulting code still has all my[b] bad indention warnings[/b]. I prefer to use a 3-space indent. I know it\'s wierd but 2 always seemed too hard to see and 4 seemed too much.
I am new to both Eclipse an Python. Pydev certainly makes programming in Python more enjoyable. Thanks for a great tool!
The following forum message was posted by crocodilek at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/3778158:
First thing - not an answer to your question. Have you heard of and read PEP 8? If not, please read it (http://www.python.org/dev/peps/pep-0008/) and follow it. It\'s not obligatory but trust me, it\'s a really good idea to follow the styling/formatting/indenting described there.
Python is very flexible and allows you to use whatever you want (tabs/spaces) and how many you want (2/3/4 spaces) but if you don\'t fallow the standard (PEP 8) anyone who has to work with your code will not be happy about it. You\'ll hate it in the future too ;-) There\'s also a great tool available, that can check your code for accordance with PEP 8: http://pypi.python.org/pypi/pep8
As for cleaning tabs and spaces mess, there\'s a really great script included in Python\'s source code called \"reindent.py\". After extracting the source you can find it in Tools/scripts directory.
On Jul 20, 2010, at 2:58 PM, SourceForge.net wrote:
> I know it\'s wierd but 2 always seemed too hard to see and 4 seemed too much.
Please use 4-space indents. This is the standard value used by all major Python projects, and the one described in PEP 8. The minor aesthetic preference you have for 3-space indents will be massively outweighed by every tool (pydev, emacs, vim) fighting you, not to mention the fact that you will need to re-indent any example code that you wish to copy.