Re: commenting out blocks of code

2006-02-19 Thread Peter Hansen
Steve Holden wrote: Steven D'Aprano wrote: On Fri, 17 Feb 2006 19:12:01 -0500, Peter Hansen wrote: Scite, for example, lets me selected a block and hit Ctrl-Q to either comment or uncomment the block. (It does this by prefixing each line with #~ instead of just #, which allows it to detect when

Re: commenting out blocks of code

2006-02-19 Thread Neil Hodgson
Atanas Banov: here is something you both seems to have not considered: imagine you make decision if ^Q has to comment or uncomment based on the 1st line and not on each line individually in the block. When first implementing Ctrl+Q, this looked to have similar advantages and disadvantages

Re: commenting out blocks of code

2006-02-18 Thread Duncan Booth
Steven D'Aprano wrote: Scite, for example, lets me selected a block and hit Ctrl-Q to either comment or uncomment the block. I see the developers of Scite are either newbies to GUI programming, or they operate in a world of their own. Ctrl-Q is reserved for Quit (or Exit) in every GUI API

Re: commenting out blocks of code

2006-02-18 Thread Steven D'Aprano
On Sat, 18 Feb 2006 03:14:49 +, Neil Hodgson wrote: I am the developer responsible for SciTE and the Ctrl+Q decision. Ctrl+Q is not reserved for Quit on every platform. [snip] Thank you for your thoughtful response. Although I'm not convinced by your reasoning, I will concede that

Re: commenting out blocks of code

2006-02-18 Thread Steve Holden
Steven D'Aprano wrote: On Fri, 17 Feb 2006 19:12:01 -0500, Peter Hansen wrote: john peter wrote: is there a similar mechanism in python, other than prefixing the '#' character to the start of each statement i do not want to execute (which gets old very quickly if one needs to comment and

commenting out blocks of code

2006-02-17 Thread john peter
in java, i can prevent a block of code from executing by bracketing the block with comment indicators, as shown below: /* statement1 will not execute; statement2 will not execute; */ statement3 will executeis there a similar mechanism in python, other than prefixing the '#'

Re: commenting out blocks of code

2006-02-17 Thread Paul McNett
john peter wrote: in java, i can prevent a block of code from executing by bracketing the block with comment indicators, as shown below: /* statement1 will not execute; statement2 will not execute; */ statement3 will execute is there a similar mechanism in python, other than

Re: commenting out blocks of code

2006-02-17 Thread Peter Hansen
john peter wrote: is there a similar mechanism in python, other than prefixing the '#' character to the start of each statement i do not want to execute (which gets old very quickly if one needs to comment and uncomment several statements a couple of times while playing around with code say

Re: commenting out blocks of code

2006-02-17 Thread Steven D'Aprano
On Fri, 17 Feb 2006 19:12:01 -0500, Peter Hansen wrote: john peter wrote: is there a similar mechanism in python, other than prefixing the '#' character to the start of each statement i do not want to execute (which gets old very quickly if one needs to comment and uncomment several

Re: commenting out blocks of code

2006-02-17 Thread Jean-Paul Calderone
On Sat, 18 Feb 2006 12:36:06 +1100, Steven D'Aprano [EMAIL PROTECTED] wrote: [snip] Commenting and uncommenting should be two different commands: the whole point of nested comments is that it allows you to comment a block of text which may already contain comments. Having one command do both

Re: commenting out blocks of code

2006-02-17 Thread Cameron Laird
In article [EMAIL PROTECTED], Paul McNett [EMAIL PROTECTED] wrote: . . . IMO this is a missing feature in Python. However, if the block of code you are wanting to comment out doesn't happen to contain any triple-quotes, you

Re: commenting out blocks of code

2006-02-17 Thread Neil Hodgson
Hi Steven, I see the developers of Scite are either newbies to GUI programming, or they operate in a world of their own. Ctrl-Q is reserved for Quit (or Exit) in every GUI API I know of. I am the developer responsible for SciTE and the Ctrl+Q decision. Ctrl+Q is not reserved for Quit

Re: commenting out blocks of code

2006-02-17 Thread Atanas Banov
Neil Hodgson wrote: Hi Steven, It is *easy* to detect when a line is already commented. It starts with a #. The ~ is superfluous. It is not usual to change a line from being code to being a comment as most lines of code make no sense as English text. If you do sometimes want to do