[Pvfs2-users] Re: 2 new comment-like characters in Python to aid
development?
rishi pathak
mailmaverick666 at gmail.com
Fri Mar 9 07:28:53 EST 2007
I tried, but could not make it work, can someone give me an example
On 3/9/07, Gabriel Genellina <gagsl-py2 at yahoo.com.ar> wrote:
>
> En Fri, 09 Mar 2007 06:14:46 -0300, <dbhbarton at googlemail.com> escribió:
>
> > A '?' placed in the preceding whitespace of a line as a means of
> > quickly highlighting a line or block of code for special attention.
> > The interpreter simply ignores these characters, and executes the code
> > as if each WIP character wasn't there. The value-added comes from how
> > IDEs can exploit this to color the line or code block (in a
> > customisable fashion as with other context-dependent IDE formatting).
>
> This could be implemented without new syntax: just make your editor
> recognize some special comments, and apply the highlighting to the
> following block. By example,
>
> # XXX Remove this when FuruFaifa is fixed to always
> provide
> # XXX the names in the same order
> names.sort()
> names.reverse()
>
> if names==oldnames:
> ...
>
> would highlight the first 4 lines (let's say, up to the next blank line or
> dedent).
>
> > 2. The HALT comment:
> >
> > A '!' at the start of a line, indicating the end of the script proper.
> > The interpreter would register this one, and ignore everything after
> > it, a bit like a sys.exit() call but also stopping it from picking
> > syntax errors after the HALT. IDEs could then 'grey out' (or 'yellow
> > out' or whatever) all following characters, including later HALT
> > comments.
>
> You accidentally type a ! somewhere, and your module stops working - not
> so good :( and worse, hard to find.
>
> I sometimes use '''this string marks''' to ignore whole blocks of code. It
> works fine unless the block already contains the same kind of
> triple-quoted string...
>
> > As far as I can see, neither of these would break backwards
> > compatibility and, like the @ decorator, if you don't like it, you
> > wouldn't have to use it. I don't know enough about the guts of Python
> > to say much about ease of implementation, but it doesn't seem like it
> > would be too hard.
>
> The main problem with new syntax is breaking compatibility with older
> versions, and I doubt it's worth the pain just for highlighting or playing
> interactively, so you don't have a great chance of them being
> implemented...
>
> --
> Gabriel Genellina
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Regards--
Rishi Pathak
National PARAM Supercomputing Facility
Center for Development of Advanced Computing(C-DAC)
Pune University Campus,Ganesh Khind Road
Pune-Maharastra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.beowulf-underground.org/pipermail/pvfs2-users/attachments/20070309/40947726/attachment.htm
More information about the Pvfs2-users
mailing list