PEP scepticism

Steve Horne sh at ttsoftware.co.uk
Mon Jul 2 10:49:07 EDT 2001


On Fri, 29 Jun 2001 19:20:58 +0100, philh at comuno.freeserve.co.uk (phil
hunt) wrote:

>2. how will this interact with python's indent/dedent mechanism
>
>In particular, how do we treat this:
>
>def myfunction():
>   print "hello"
>   print "start" /* start of comment
>middle of comment
>end of comment */   print "goodbye"
>
>IMO the best way to prevent unexpected wierdness like this is
>to forbid any code in any line after the */ closing-comment
>sequence; or perhaps to give a warning and ignore it (it
>shouldn't just be silently ignored, as this will confuse people
>familiar to how it works in C).

My opinion is that it should also ban comment text from being further
left than the start comment marker. That would pretty much force a
layout like this...

print "Hello"  /*  This is a
                   hello world
                   thingy       */

A similar rule about the right margin and end comment marker wouldn't
work - some people might prefer...

print "Hello"  /*  This is a
                   hello world
                   thingy
               */

To be honest, though, I personally wouldn't use this. It raises the
age-old spectre of the missing end-of-comment, which can cause no end
of confusion in C.

I'd also consider whether /# and #/ are better markers - more directly
related to the existing #.

-- 
Steve Horne
Home : steve at lurking.demon.co.uk
Work : sh at ttsoftware.co.uk



More information about the Python-list mailing list