[Pythonmac-SIG] Selecting in BBEdit & Python Indenting style (spaces)

David Person david at personconsulting.com
Tue Nov 29 21:12:39 CET 2005


Odd, I always use 2 spaces, and haven't really heard 4 was standard.  
I don't keep up much with those things, though :)

Tabs are certainly allowed. There is a potential difficulty in mixing  
tabs and spaces in the same file, since it is unclear how many spaces  
go into a tab, so there is potential for ambiguity.

The WingIDE notices the file's indentation style and helps keep it  
straight. When debugging, I sometimes get a warning because the  
standard python libraries sometimes use different standards, and I  
have Wing setup to warn me in those cases.

The WingIDE lets you choose which style to use. If you press tab, it  
tabs to the next potential spot, semi-intelligently - not just the  
next tab marker. Similar with backspace.

I think Wing has done a great job in simplifying the tab/spaces  
difficulties, but they have quite a sophisticated algorithm for it -  
more complicated than ideally would be necessary, but it does  
eliminate the problem.

-dp-

On Nov 29, 2005, at 11:40 AM, Chris Barker wrote:

> Louis Pecora wrote:
>
>> You hold down the option key while selecting, but you cannot do this
>> in the soft wrap mode.  You have to set the window to hard wrap at
>> some column number.  If you have the BBEdit manual, you can find more
>> info around page 52 or just look in the index.
>
> thanks.
>
>
>> What the heck were they (Guido?) thinking when they used 4 spaces as
>> the one true mode of indentation for Python?
>
> I have no clue. It was a bad idea, from the beginning, to allow mixed
> tabs+spaces. (I still don't understand why that hasn't been completely
> deprecated).
>
>> I would think that TAB would be infinitely better and avoid the
>> problems you point out that probably plague a lot of editors when
>> doing Python code.
>
> I agree. Tabs would be easier in most cases, but:
>
>> And many editors allow you to set the size of the
>> TAB (e.g. 2 spaces in size if you think 4 looks too large -- I do).
>
> Well, that is an issue. I think there is a trade off between people
> making their own choice about what things should look like and
> consistency. Also, aside form changing the size of tabs, various  
> places
> people use text, like in email messages, html, etc, tabs get  
> mangled, so
> that may be why spaces were selected as the standard. Or maybe  
> there is
> no logic, and it's just what Guido likes.
>
> As it happens, the Mac is the only place I've ever had a problem, both
> in the old macPython IDE and BBedit. All other editors I've used (at
> least mildly competent ones) have been fine.
>
> -Chris
>
>
> -- 
> Christopher Barker, Ph.D.
> Oceanographer
>                                      		
> NOAA/OR&R/HAZMAT         (206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115       (206) 526-6317   main reception
>
> Chris.Barker at noaa.gov
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
>



More information about the Pythonmac-SIG mailing list