Compare source code

Tim Harig usernet at ilthio.net
Tue Nov 2 20:41:46 EDT 2010


On 2010-11-02, D'Arcy J.M. Cain <darcy at druid.net> 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:
     
         bar
	 
     else:

         baz

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

         quux

     # }}}

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