[EMAIL PROTECTED] a écrit :
(snip about tokenizers - not exactly my domain, sorry)
>
> Have I got those quotes right?
Perfect !-)
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote:
> Is the array of lines the appropriate data structure here ?
I've done tokenizers both as an array of lines and as a long string.
The former has seemed easier when the language treats EOL as a
statement separator.
re not letting literal strings in code terminate bloc
d.
wrt/ your above example, making it a legal construct imply that you
should not consider the block start/end markers as comment markers if
they are enclosed in string-litteral markers.
Now this doesn't solve the problem of nested block comments. Here, I
guess the solution would be to o
Tomorrow is block comment day. I want them to nest. I think the reason
that they don't routinely nest is that it's a lot of trouble to code.
Two questions:
1) Given a start and end location (line position and char index) in an
array of lines of text, how do you Pythonly extract the whole block
com
In article <[EMAIL PROTECTED]>,
"Jonathan Gardner" <[EMAIL PROTECTED]> wrote:
> Warby wrote:
> > ...and I forgot to mention that the output of grep and diff is far more
> > understandable in the absence of block comments!
>
> Which is why people do t
Warby wrote:
> ...and I forgot to mention that the output of grep and diff is far more
> understandable in the absence of block comments!
Which is why people do this /anyway/. (Kind of makes block comments
pointless, doesn't it?
/* This is a
* really
* really
* long
* bl
On Sat, 11 Mar 2006 10:23:56 +1100
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote:
> On Thu, 09 Mar 2006 18:02:27 -0600, Terry Hancock wrote:
>
> > On 9 Mar 2006 07:21:00 -0800
> > "msoulier" <[EMAIL PROTECTED]> wrote:
> >> > (and if you don't, you can quickly comment out
> >regions > > by putting t
On Thu, 09 Mar 2006 18:02:27 -0600, Terry Hancock wrote:
> On 9 Mar 2006 07:21:00 -0800
> "msoulier" <[EMAIL PROTECTED]> wrote:
>> > (and if you don't, you can quickly comment out regions
>> > by putting them inside a triple-quoted string.)
>>
>> Although that will use up memory, as opposed to a
On 9 Mar 2006 07:21:00 -0800
"msoulier" <[EMAIL PROTECTED]> wrote:
> > (and if you don't, you can quickly comment out regions
> > by putting them inside a triple-quoted string.)
>
> Although that will use up memory, as opposed to a comment.
Not really. Unless it is the first string in the block
(
msoulier wrote:
>> (and if you don't, you can quickly comment out regions by putting them
>> inside a triple-quoted string.)
>
> Although that will use up memory, as opposed to a comment.
Doesn't seem so:
>>> def f():
... "docstring"
... "another string"
... a = 42
... "yet ano
msoulier <[EMAIL PROTECTED]> wrote:
>> (and if you don't, you can quickly comment out regions by putting them
>> inside a triple-quoted string.)
>
>Although that will use up memory, as opposed to a comment.
I can't imagine a realistic scenario where the amount of memory wasted
by triple-quoting ou
> (and if you don't, you can quickly comment out regions by putting them
> inside a triple-quoted string.)
Although that will use up memory, as opposed to a comment.
Still, it's simple enough in an editor like Vim or Emacs to highlight a
region, and define a macro to add/remove #s. Any Python IDE
Terry Hancock wrote:
> I'm thinking this might be a use-case for the new support for
> doctests in a separate file.
Having doctests in their own file is (IMHO) a majorly under appreciated
feature of doctest. The ability to do either nice user (as in
developer) docs with known good examples or w
I have found that some editors colourize text based on parsing a
section of text around what is visible. Long, multi-line comments or
strings might not then get colored correctly.
Personally, I do use block comments in other languages but maybe they
should not exist in finished code for reasons
On Wednesday 08 March 2006 12:42 pm, Warby wrote:
> The danger with block comments is that there is no way to tell that the
> code you're looking at has been commented out unless you can see the
> start or end of the comment block. If you have a modern editor, it
> probably cha
Warby <[EMAIL PROTECTED]> wrote:
>Eliminating block comments eliminates uncertainty. :)
An even better way to eliminate uncertainty is to eliminate the code.
Commenting out is fine for a quick test during development. Once the
code is committed, the dead code should be eliminated c
Warby wrote:
> The danger with block comments is that there is no way to tell that the
> code you're looking at has been commented out unless you can see the
> start or end of the comment block. If you have a modern editor, it
> probably changes the color of all commented out
...and I forgot to mention that the output of grep and diff is far more
understandable in the absence of block comments!
--
http://mail.python.org/mailman/listinfo/python-list
It's clear that if you have a modern editor, block comments are
unnecessary because it is trivial to add a # to the start of each line
of a block, but that doesn't really answer your question. It explains
why you might not always need block comments but doesn't explain why
you sho
Roy Smith wrote:
> > you can quickly comment out regions by putting them
> > inside a triple-quoted string.)
>
> Except that triple-quotes don't nest.
''' """...except when they do""" '''
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> you can quickly comment out regions by putting them
> inside a triple-quoted string.)
Except that triple-quotes don't nest.
I do agree, however, with the idea that any decent editor should be
able to comment out a block of code faster than I can type thi
John Salerno wrote:
> I'm still tyring to figure out what "Pythonic" means, and I have a
> feeling the answer to my question may fall into that category. Are block
> comments somehow unpythonic?
only in the sense that python don't have them.
but they're pret
I'm still tyring to figure out what "Pythonic" means, and I have a
feeling the answer to my question may fall into that category. Are block
comments somehow unpythonic?
--
http://mail.python.org/mailman/listinfo/python-list
23 matches
Mail list logo