Re: Programming first steps.
ma, 2003-11-17 kello 18:49, Steve Greenland kirjoitti:
> To clarify: AFAICT, Python is perfectly happy with any sort of
> indentation you choose, so long as it's consistent in any given block.
> You want to use '<space><space><tab>', fine. Just don't try to mix it
> with '<space><tab>' in the same block.
This topic is rather off-topic for -devel, I guess, but I'd like to
point out that the above is not how Python deals with tabs and spaces.
What it does, is expand the tabs and compare the indentations after that
- this is, of course, the only sensible solution and takes care of any
mix of spaces and tabs. Tab stops are every eight spaces (though I guess
there may be a way to change that, if you're perverse), and the Python
interpreter has the -t option to make it warn if tabs are being used
inconsistently, i.e., if both spaces and tabs are used for indentation,
if you're worried about that.
> I would expect any editor that claims to have a Python mode to DTRT.
I've written Python code for a decade, with an assortment of editors.
Almost none have had a Python mode, and never have I had any trouble
with indentations. For example, I did not have any problem using /bin/ed
for editing Python code (over a 1200 bit/s modem line, for which even vi
was rather slow).