Den onsdagen den 30:e oktober 2013 kl. 15:22:50 UTC+1 skrev Alister: > On Wed, 30 Oct 2013 13:42:37 +0100, Antoon Pardon wrote: > > > > > Op 30-10-13 13:17, Chris Angelico schreef: > > >> On Wed, Oct 30, 2013 at 11:01 PM, Antoon Pardon > > >> <antoon.par...@rece.vub.ac.be> wrote: > > >> I broadly agree with your post (I'm of the school of thought that > > >> braces are better than indentation for delimiting blocks), but I don't > > >> think this argument holds water. All you need to do is be consistent > > >> about tabs OR spaces (and I'd recommend tabs, since they're simpler and > > >> safer), and you'll never have this trouble. > > > > > > Easier said than done. First of all I can be as consistent as possible, > > > I can't just take code from someone else and insert it because that > > > other person may be consistenly doing it different from me. > > > > I disagree it is very easy. > > > > 1) make sure you editor is set to inset 4 spaces rather than tab when > > pressing the tab key. consistency in your own code is now not an issue. > > > > 2) when importing code from someone else a simple search & replace of tab > > with 4 spaces will instantly correct the formatting on code using tab > > without breaking code that doesn't. > > > > > > > > > > Then if you are working on different machines, the settings of your > > > editor may not always be the same so that you have tabs on one machine > > > and spaces on an other, which causes problem when you move the code. > > > > > that is fixed by setting your environment consistantly but step 2 above > > will fix it if you forget. > > > > > Also when you have an xterm, selecting a tab and pasting it into another > > > it will turn the tab into spaces. > > > > Read pep 11 & always use 4 spaces for indentation not tab. > > > > > > > > All these things usually can be ignored, they typically only show up > > > when you print something and things aren't aligned as you expect but > > > with python you are forced to correct those things immediately, forcing > > > you to focus on white space layout issues instead of on the logic of the > > > code. > > > > > >> Also, the parser should tell you if you mix tabs and spaces, so that > > >> won't trip anything either. > > > > > > Maybe you mean something different than I understand but a program > > > throwing a syntax error because there is a tab instead of a number of > > > spaces or vice versa, is something I would understand as tripping. > > > > no more than failing to close a brace in a C like language > > indentation is the syntax of python you will grow to love it, like most > > people I found it distracting at first even though i tended to indent > > other code (inconsistently)to make it readable. > > > > > > > > > > -- > > I am what you will be; I was what you are.
Alister i do not ask for changing the actual implementation with indents that the compiler/interpretator work with. What i ask for is some courtesy relative the programmers using IDLE, to incorporate a simple automatic parser that let them who like to write slopy formatted with end instead to do so. And the parser in editor automaticly go in and autoindent *function, loops, if and allow end that the editor autoindent to end of loop. It can not be that hard i have implemented my own python using this... -- https://mail.python.org/mailman/listinfo/python-list