PEP 350: Codetags

Magnus Lie Hetland mlh at selje.idi.ntnu.no
Mon Oct 3 18:08:16 EDT 2005


In article <mailman.1041.1127862456.509.python-list at python.org>, Terry
Hancock wrote:
[snip]
>The <> terminator is evil.  People will hate that. If there are no fields,
>you should just be able to leave it off. This will have an additional
>advantage in that many will already have compliant codetags if you leave
>off this requirement.

I heartily agree. I use codetags like these all the time -- *except*
that I don't add the "<>" at the end.

>You worry over the need to detect the end of the block, but wouldn't '\n\n'
>be a much more natural delimiter?  I.e.:

That would make perfect sense, and is in no way restrictive.

># TODO: This is a multi-line todo tag.
>#       You see how I've gone to the next line.
>
># This, on the other hand is an unrelated comment. You can tell it's not
># related, because there is an intervening blank line.  I think people
># do this naturally when writing comments (I know I do -- I'm fairly
># certain I've seen other people do it).
>#
># Whereas, as you can see, a mere paragraph break can be represented by
># a blank comment line.

Indeed.

># Whitespace formatting, after all, is VERY PYTHONIC. ;-)
># Delimiters on the other hand -- well, we prefer not to mention
># the sort of languages that use those, right? ;-)

<shudder>

IMO, the syntax could be really simple: One comment (one or more
contiguous comment lines) that start with

  # FOO:

(with FOO being any of the tags) is grouped along with the tag. One
can dhen optionally add the <...> stuff at the end. (Not sure if that
would be my preferred syntax for it, but I won't complain as much
about that as about the empty '<>' thing :)

-- 
Magnus Lie Hetland     "The early bird may get the worm but the second
http://hetland.org      mouse gets the cheese."       -- Willie Nelson



More information about the Python-list mailing list