Re: Colons, indentation and reformatting. (2)

2007-01-10 Thread Hendrik van Rooyen
Jorgen Grahn [EMAIL PROTECTED]wrote: On 8 Jan 2007 23:57:29 -0800, Paddy [EMAIL PROTECTED] wrote: OK, whilst colons are not sufficient to re-format a completely mis-indented file. I'm thinking that they are sufficient for reformatting most pasted code blocks when refactoring say?

Re: Colons, indentation and reformatting. (2)

2007-01-09 Thread Diez B. Roggisch
Won't the following rules work when pasting complete Python statements and complete lines, after other lines in an editor: lets call the line after which the block is to be pasted the paste line, and the original indent of the first line of the copied block to be pasted the copy indent.

Re: Colons, indentation and reformatting. (2)

2007-01-09 Thread Paddy
OK, whilst colons are not sufficient to re-format a completely mis-indented file. I'm thinking that they are sufficient for reformatting most pasted code blocks when refactoring say? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Colons, indentation and reformatting.

2007-01-09 Thread Leif K-Brooks
Paddy wrote: Thinking about it a little, it seems that a colon followed by non-indented code that has just been pasted in could also be used by a Python-aware editor as a flag to re-indent the pasted code. How would it reindent this code? if foo: print Foo! if bar: print Bar! Like this? if

Re: Colons, indentation and reformatting. (2)

2007-01-09 Thread Paul McGuire
Paddy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If this is not the case then the user should be asked wether to re-indent the copy block to be equal to, or de-dented w.r.t. the paste line indent prior to pasting. How would the user know this? Every dedent is ambiguous,

Re: Colons, indentation and reformatting. (2)

2007-01-09 Thread Jorgen Grahn
On 8 Jan 2007 23:57:29 -0800, Paddy [EMAIL PROTECTED] wrote: OK, whilst colons are not sufficient to re-format a completely mis-indented file. I'm thinking that they are sufficient for reformatting most pasted code blocks when refactoring say? Let's put it this way: if the formatter can

Re: Colons, indentation and reformatting.

2007-01-09 Thread Neil Cerutti
On 2007-01-09, Leif K-Brooks [EMAIL PROTECTED] wrote: Paddy wrote: Thinking about it a little, it seems that a colon followed by non-indented code that has just been pasted in could also be used by a Python-aware editor as a flag to re-indent the pasted code. How would it reindent this

Colons, indentation and reformatting.

2007-01-08 Thread Paddy
i was just perusing a Wikipedia entry on the off side rule at http://en.wikipedia.org/wiki/Off-side_rule . It says that the colon in Python is purely for readability, and cites our FAQ entry http://www.python.org/doc/faq/general.html#why-are-colons-required-for-the-if-while-def-class-statements .

Colons, indentation and reformatting. (2)

2007-01-08 Thread Paddy
I was just perusing a Wikipedia entry on the off side rule at http://en.wikipedia.org/wiki/Off-side_rule . It says that the colon in Python is purely for readability, and cites our FAQ entry http://www.python.org/doc/faq/general.html#why-are-colons-required-fo... . However, near the top of the

Re: Colons, indentation and reformatting. (2)

2007-01-08 Thread [EMAIL PROTECTED]
Paddy wrote: I was just perusing a Wikipedia entry on the off side rule at http://en.wikipedia.org/wiki/Off-side_rule . It says that the colon in Python is purely for readability, and cites our FAQ entry http://www.python.org/doc/faq/general.html#why-are-colons-required-fo... . However,

Re: Colons, indentation and reformatting. (2)

2007-01-08 Thread Paul McGuire
Paddy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I was just perusing a Wikipedia entry on the off side rule at http://en.wikipedia.org/wiki/Off-side_rule . It says that the colon in Python is purely for readability, and cites our FAQ entry

Re: Colons, indentation and reformatting. (2)

2007-01-08 Thread Paddy
[EMAIL PROTECTED] wrote: Paddy wrote: I was just perusing a Wikipedia entry on the off side rule at http://en.wikipedia.org/wiki/Off-side_rule . It says that the colon in Python is purely for readability, and cites our FAQ entry

Re: Colons, indentation and reformatting. (2)

2007-01-08 Thread Paddy
Paul McGuire wrote: Paddy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I was just perusing a Wikipedia entry on the off side rule at http://en.wikipedia.org/wiki/Off-side_rule . It says that the colon in Python is purely for readability, and cites our FAQ entry