[Bf-python] Scripts: spaces, tabs and consistency

Stephen Swaney sswaney at centurytel.net
Thu Mar 16 18:43:34 CET 2006


On Mon, Mar 13, 2006 at 04:15:29PM -0700, Chris Want wrote:
> 
> Hi,
> 
> What is the standard for scripts? Tabs or spaces?
> I think most of the scripts in CVS use tabs, but
> not all.

Tabs are nice!

Guido van Rossum - the PyFather - has this to say about style:

A style guide is about consistency. 
Consistency with this style guide is important. 
Consistency within a project is more important.  
Consistency within one module or function is most important.
...
Never mix tabs and spaces. 
The most popular way of indenting Python is with spaces only. 
The second-most popular way is with tabs only


> P.S. Below is the output of what I get when I run 'file' on
> the scripts on the scripts in CVS. Some are very wrongly
> classified as Java, don't know why, but others should be
> examined for improper line terminators.

I looked into the 'file' command docs a bit.  Basically,
it first looks for a magic number in the file.  If no
magic number, it tries to identify the character set used.
After that, it does some matching to try to identify the
type of text.  Apparently python is close enough java to 
fool it.

Maybe we should register the #!BPy as a standard magic number?
-- 
Stephen Swaney			
sswaney at centurytel.net




More information about the Bf-python mailing list