DOS, UNIX and tabs

Steven D'Aprano steve at REMOVEME.cybersource.com.au
Wed Dec 27 22:22:21 EST 2006


On Wed, 27 Dec 2006 20:15:33 +0100, Sebastian 'lunar' Wiesner wrote:

> Ben <Benjamin.Barker at gmail.com> typed
> 
>> I have a python script on a windows system that runs fine. Both use
>> tabs to indent sections of the code.
> 
> Just a tip for you: In python you never use tabs for indentation. The
> python style guide [1] recommends four spaces per indentation level.
> 
> [1] http://www.python.org/dev/peps/pep-0008/

[obligatory pot-shot in the never-ending spaces versus tabs war]

In Python, I frequently use tabs for indentation, and I never have any
trouble *except* when posting code to Usenet, where other people's news
readers can't cope with tabs.

But I think we all agree that mixing tabs and spaces is A Very Bad Thing.



-- 
Steven D'Aprano 




More information about the Python-list mailing list