Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

Carl J. Van Arsdall cvanarsdall at mvista.com
Wed May 17 21:02:46 CEST 2006


Andy Sy wrote:
> Carl J. Van Arsdall wrote:
>
>   
>>> Next major objection then, how can one practically use 'tabs as
>>> semantic indentation' without screwing up formatting of code like
>>> the below??
>>>
>>>
>>>   def sqlcall():
>>>       cursor.execute('select id, item, amount, field4, field5, field6'+
>>>                      'from table1 where amount>100')
>>>
>>>   
>>>       
>> Why couldn't you tab your third line over as close as possible to the 
>> start of the quote then use a couple spaces?  Then the tabs would work 
>> just fine and you could still have your pretty line.
>>     
>
>
> This will break if someone tries to view my code using different
> tab settings from the one I'm using
>   
Uh, no it won't.  It should be read in as "one tab and two spaces" 
regardless of the tabstop setting.

.c


-- 

Carl J. Van Arsdall
cvanarsdall at mvista.com
Build and Release
MontaVista Software




More information about the Python-list mailing list