Compare source code

Tim Harig usernet at
Wed Nov 3 01:41:46 CET 2010

On 2010-11-02, D'Arcy J.M. Cain <darcy at> wrote:
> "Redundant" is right.  However, there is a use for such comments:
>     if foo:
>         bar
>     else:
>         baz
>         if snafu:
>             cookie
>         #endif snafu
>         quux
>     #endif foo

Actually, I have found similar markers to be useful everywhere.  I don't
like the way my editor tries to fold Python code, so I started inserting
folding markers myself:

     # foo {{{
     if foo:


	 # snafu {{{
         if snafu:
         # }}}


     # }}}

If the bar, baz, and quux blocks are large enough logical units, I will
fold them as well.

What I found is that the makers become an incredibly useful form of
organzational tool.

More information about the Python-list mailing list