PEP scepticism

phil hunt philh at comuno.freeserve.co.uk
Tue Jul 3 11:15:10 EDT 2001


On Mon, 02 Jul 2001 15:49:07 +0100, Steve Horne <sh at ttsoftware.co.uk> wrote:
>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       */

But i don't want to *force* certain layouts. If I did, I'd be coding
in Pascal or something, not python.

IMO, arbitrary restrictions are bad.


>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.

That's a good point. Syntax-highlighting can help here, though.

-- 
## Philip Hunt ## philh at comuno.freeserve.co.uk ##







More information about the Python-list mailing list