Python end of file marker similar to perl's __END__

kyosohma at gmail.com kyosohma at gmail.com
Thu Aug 2 09:38:39 EDT 2007


On Aug 2, 8:08 am, Neil Cerutti <horp... at yahoo.com> wrote:
> On 2007-08-02, Magnus Lycka <ly... at carmen.se> wrote:
>
>
>
> > Neil Cerutti wrote:
> >> On 2007-08-01, Cameron Laird <cla... at lairds.us> wrote:     .
> >>> I want to re-emphasize the "triple-quote it" tip mentioned
> >>> earlier in this thread.  I think the original questioner
> >>> will find this quite satisfying, if I understand his situ-
> >>> ation at all.
>
> >>> *I* certainly have source code with embedded "junk"
> >>> commented out as multi-line strings.
>
> >> I used to do that, but now that I use doctests so much it's
> >> infeasible to comment out arbitrary code that way, since they
> >> can't necessarily nest.
>
> > If you consistently use e.g. ''' for doc strings, you can use
> > """ to comment out code blocks.
>
> But then I couldn't use """ in my docstrings! ;) Actually, I
> wound up converting all my multiline doctests to use
> concatenation instead, since they were ruining my syntax
> highlighting performance in Vim.
>
> --
> Neil Cerutti
> We shall reach greater and greater platitudes of achievement. --Richard J.
> Daley

Python comes with an IDE that can do bulk commenting or uncommenting.
It's IDLE. Just select the test to comment out and press ALT+3. To
uncomment, press ALT+4.

It's cool!

Mike




More information about the Python-list mailing list