Re: Python "why" questions

2010-08-20 Thread Kai Borgolte
Russ P. wrote:

>> A simple example: Using zero-based indexing, suppose you want to indent
>> the string "spam" so it starts at column 4. How many spaces to you
>> prepend?

No, you won't want to indent a string so it starts at column 4. You
simply want to indent the string by four spaces. Like in PEP 8:

/Use 4 spaces per indentation level./

> 0123456789
>     spam

And of course your text editor will number the columns beginning with
one, so the string starts at column 5.

123456789
    spam
-- 
Kai Borgolte, Bonn
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python "why" questions

2010-08-20 Thread Kai Borgolte
Sorry about my previous posting with wrong references, this one should
be better.

Steven D'Aprano wrote:

>A simple example: Using zero-based indexing, suppose you want to indent 
>the string "spam" so it starts at column 4. How many spaces to you 
>prepend?

No, you won't want to indent a string so it starts at column 4. You
simply want to indent the string by four spaces. Like in PEP 8:

/Use 4 spaces per indentation level./

>0123456789
>spam

And of course your text editor will number the columns beginning with
one, so the string starts at column 5.

123456789
    spam
-- 
Kai Borgolte, Bonn
-- 
http://mail.python.org/mailman/listinfo/python-list