i have to change default tab length in pydev
Rhodri James
rhodri at wildebst.demon.co.uk
Sun Mar 29 18:13:46 EDT 2009
On Sat, 28 Mar 2009 11:30:36 -0000, Coonay <flankw at gmail.com> wrote:
> during last few days, i code python using notepad++ or pydev, the
> compiler always complain there is a problem with Indentation,in my
> eyes ,there is no Indentation problem at all,because i format the code
> to make it comply with python style guide strictly,but after i change
> the default tab length ,it works.
If you're mixing tabs and spaces, which from your description you are,
then you aren't complying strictly with the Python style guide. PEP 8
says:
"""
Tabs or Spaces?
Never mix tabs and spaces.
"""
Clearly the compiler was considering tabs to be a different width to
your editor's initial setting. Where you saw:
Line starting with 8 spaces
Line starting with a tab
in the editor window, the compiler instead saw:
Line starting with 8 spaces
Line starting with a tab
or something like that. Running with "python -t" will warn you about
this sort of thing.
--
Rhodri James *-* Wildebeeste Herder to the Masses
More information about the Python-list
mailing list