On Thursday, June 16, 2016 at 8:34:46 PM UTC+12, Yubin Ruan wrote:
> print "A test case" + \
>"str_1[%s] " + \
>"str_2[%s] " % (str_1, str_2)
Try this:
print \
(
"A test case"
"str_1[%s] "
"str_2[%s] "
%
(str_1, str_2)
)
Python takes this n
"Yubin Ruan" wrote in message
news:930753e3-4c9c-45e9-9117-d340c033a...@googlegroups.com...
Hi, everyone, I have some problem understand the rule which the python
compiler use to parsing the multiline string.
Consider this snippet:
str_1 = "foo"
str_2 = "bar"
print "A test case" + \
Yubin Ruan writes:
> Hi, everyone, I have some problem understand the rule which the python
> compiler use to parsing the multiline string.
>
> Consider this snippet:
>
> str_1 = "foo"
> str_2 = "bar"
>
> print "A test case" + \
>"str_1[%s] " + \
>"str_2[%s] " % (str_1, str_2)
>
>
Yubin Ruan wrote:
> Hi, everyone, I have some problem understand the rule which the python
> compiler use to parsing the multiline string.
>
> Consider this snippet:
>
> str_1 = "foo"
> str_2 = "bar"
>
> print "A test case" + \
>"str_1[%s] " + \
>"str_2[%s] " % (str_1, str_2)
>
On Wed, 21 Jul 2010 10:06:14 -0500, Brandon Harris wrote:
> what do you mean by slurp the entire file? I'm trying to use regular
> expressions because line by line parsing will be too slow. And example
> file would have somewhere in the realm of 6 million lines of code.
And you think trying to r
Brandon Harris wrote:
> I'm trying to read in and parse an ascii type file that contains
> information that can span several lines.
> Example:
What about something like this (you need re.MULTILINE):
In [16]: re.findall('^([^ ].*\n([ ].*\n)+)', a, re.MULTILINE)
Out[16]:
[('createNode animCurveTU
>>> I could make it that simple, but that is also incredibly slow and on
>>> a file with several million lines, it takes somewhere in the league of
>>> half an hour to grab all the data. I need this to grab data from
>>> many many file and return the data quickly.
>>>
>>> Brandon L. Harris
>>>
>> T
Could it be that there isn't just that type of data in the file? there
are many different types, that is just one that I'm trying to grab.
Brandon L. Harris
Andreas Tawn wrote:
I could make it that simple, but that is also incredibly slow and on a
file with several million lines, it takes som
> I could make it that simple, but that is also incredibly slow and on a
> file with several million lines, it takes somewhere in the league of
> half an hour to grab all the data. I need this to grab data from many
> many file and return the data quickly.
>
> Brandon L. Harris
That's surprising.
I could make it that simple, but that is also incredibly slow and on a
file with several million lines, it takes somewhere in the league of
half an hour to grab all the data. I need this to grab data from many
many file and return the data quickly.
Brandon L. Harris
Andreas Tawn wrote:
I'm
Brandon Harris wrote:
> I'm trying to read in and parse an ascii type file that contains
> information that can span several lines.
> Example:
>
> createNode animCurveTU -n "test:master_globalSmooth";
> setAttr ".tan" 9;
> setAttr -s 4 ".ktv[0:3]" 101 0 163 0 169 0 201 0;
> setAttr -
> I'm trying to read in and parse an ascii type file that contains
> information that can span several lines.
> Example:
>
> createNode animCurveTU -n "test:master_globalSmooth";
> setAttr ".tan" 9;
> setAttr -s 4 ".ktv[0:3]" 101 0 163 0 169 0 201 0;
> setAttr -s 4 ".kit[3]" 10;
>
At the moment I'm trying to stick with built in python modules to create
tools for a much larger pipeline on multiple OSes.
Brandon L. Harris
Eknath Venkataramani wrote:
On Wed, Jul 21, 2010 at 8:12 PM, Brandon Harris
mailto:brandon.har...@reelfx.com>> wrote:
I'm trying to read in an
On Wed, Jul 21, 2010 at 8:12 PM, Brandon Harris
wrote:
> I'm trying to read in and parse an ascii type file that contains
> information that can span several lines.
>
Do you have to use only regex? If not, I'd certainly suggest 'pyparsing'.
It's a pleasure to use and very easy on the eye too, if
what do you mean by slurp the entire file?
I'm trying to use regular expressions because line by line parsing will
be too slow. And example file would have somewhere in the realm of 6
million lines of code.
Brandon L. Harris
Rodrick Brown wrote:
Slurp the entire file into a string and pick o
Slurp the entire file into a string and pick out the fields you need.
Sent from my iPhone 4.
On Jul 21, 2010, at 10:42 AM, Brandon Harris wrote:
> I'm trying to read in and parse an ascii type file that contains information
> that can span several lines.
> Example:
>
> createNode animCurveTU
Guy Doune schrieb:
Hi,
I try to figure out what gonna be the equivalent of :
(.*?)
For the same purpose on multiline basis.
I would like completed the variable part of elements that I searching for.
Example :
align="center">
Is the begining of the variable element that I wanna completed..
Hi,
I try to figure out what gonna be the equivalent of :
(.*?)
For the same purpose on multiline basis.
I would like completed the variable part of elements that I searching for.
Example :
align="center">
Is the begining of the variable element that I wanna completed...
Is the end of t
http://www.w3.org/TR/REC-xml/#sec-white-space is relevant, as is the
following section on handling carriage returns.
Don't mix C escapes "\n" and XML markup - there really is is no point, and
it reduces the portability of the XML. XML lets you put carriage returns in
without excapes into text, and
King wrote:
> Is there any other way to define multiline text in a XML file:
>
>
>
Yes, without the CDATA, for example. XML doesn't treat line ending characters
any different from other characters.
I have no idea what you are trying to achieve since you didn't tell us (and
this newsgroup seems
King wrote:
> Is there any other way to define multiline text in a XML file:
>
>
>
Unless someone has to edit the XML manually (which is bad anyway):
first line\nsecond line
--
http://mail.python.org/mailman/listinfo/python-list
>
> Any chance you are doing this on Windows and Excel doesn't like the
> return+linefeed line endings that Windows produces when writing files in
> text mode? Try 'wb' as mode for the output file.
>
> Ciao,
> Marc 'BlackJack' Rintsch
>
Fixed! Can't believe I missed that...
Thank you for
On Sun, 23 Mar 2008 23:30:11 -0700, felciano wrote:
> The following reproduces the problem in python 2.5:
>
> import csv
> row = [1,"hello","this is\na multiline\ntext field"]
> writer = csv.writer(open("test.tsv", "w"), dialect="excel-tab",
> quotechar='"')
> writer.writerow(row)
>
> When openi
On Wednesday 13 June 2007 4:04 am, Duncan Booth wrote:
> "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> > But you already have "multiline" lambdas right now in that sense, no
> > need to add anything. I think you were talking about lambdas *with*
> > statements inside.
> >
> > bin = lambda x:((
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> But you already have "multiline" lambdas right now in that sense, no
> need to add anything. I think you were talking about lambdas *with*
> statements inside.
>
> bin = lambda x:((x&8 and '*' or '_') +
> (x&4 and '*' or '_') +
>
En Tue, 12 Jun 2007 20:48:41 -0300, Josh Gilbert
<[EMAIL PROTECTED]> escribió:
> Guido doesn't want multiline lambdas, that's a really good reason not to
> add
> them. They are, on the other hand, very useful at times. Even if he did
> add
> multiline lambdas it's not certain that he would a
On 12 Jun., 20:17, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Jun 12, 11:36 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 12 Jun., 16:54, George Sakkis <[EMAIL PROTECTED]> wrote:
>
> > > On Jun 12, 10:12 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
> > > > On 12 Jun., 14:57, Facundo
--- Josh Gilbert <[EMAIL PROTECTED]> wrote:
>
> I know that the standard Python response is that you
> might as well define a
> function, indeed, the name might provide useful
> documentation. In reality,
> however, the vast majority of my anonymous functions
> are callbacks (tends to
> lead to na
On 6/12/07, Facundo Batista <[EMAIL PROTECTED]> wrote:
Josh Gilbert wrote:
> I don't expect multiline lambdas to be added to Python. I'm not so sure
that
> that's a bad thing. Regardless, isn't it possible to write your own
Yes, it is a bad thing.
Why? Because it would another way to do somet
On Jun 12, 11:36 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
> On 12 Jun., 16:54, George Sakkis <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jun 12, 10:12 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
> > > On 12 Jun., 14:57, Facundo Batista <[EMAIL PROTECTED]> wrote:
>
> > > > Remember that the *only*
On 12 Jun., 16:54, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Jun 12, 10:12 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
> > On 12 Jun., 14:57, Facundo Batista <[EMAIL PROTECTED]> wrote:
>
> > > Remember that the *only* difference between the two functions is that
> > > one is anonymous, and fo
On Jun 12, 10:12 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
> On 12 Jun., 14:57, Facundo Batista <[EMAIL PROTECTED]> wrote:
>
> > Remember that the *only* difference between the two functions is that
> > one is anonymous, and for other you have to came up with a name (name
> > that if is well thou
On 12 Jun., 14:57, Facundo Batista <[EMAIL PROTECTED]> wrote:
> Remember that the *only* difference between the two functions is that
> one is anonymous, and for other you have to came up with a name (name
> that if is well thought, actually adds readibility to your code).
The difference is that
Josh Gilbert wrote:
> I don't expect multiline lambdas to be added to Python. I'm not so sure that
> that's a bad thing. Regardless, isn't it possible to write your own
Yes, it is a bad thing.
Why? Because it would another way to do something you can do in other
way.
The *only* big value of lam
On Tue, 12 Jun 2007 02:29:31 -0700, exhuma.twn wrote
> lambdas are to be removed in Py3k IIRC.
No. From http://www.python.org/dev/peps/pep-3099/, "At one point lambda was
slated for removal in Python 3000. Unfortunately no one was able to come up
with a better way of providing anonymous functions.
On Jun 12, 5:57 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Tue, 12 Jun 2007 00:02:37 -0300, Josh Gilbert
> <[EMAIL PROTECTED]> escribió:
>
> > I don't expect multiline lambdas to be added to Python. I'm not so sure
> > that
> > that's a bad thing. Regardless, isn't it possible to write
En Tue, 12 Jun 2007 00:02:37 -0300, Josh Gilbert
<[EMAIL PROTECTED]> escribió:
> I don't expect multiline lambdas to be added to Python. I'm not so sure
> that
> that's a bad thing. Regardless, isn't it possible to write your own
> implementation of multiline lambdas as functions? Wouldn't tha
Hi,
Thanks a lot for useful hints to all of you who replied to my question.
I could easily do now what I wanted.
Cheers,
Zdenek
Holger Berger wrote:
> Hi,
>
> yes:
>
> import re
>
> a="""
> I Am
> Multiline
> but short anyhow"""
>
> b="(I[\s\S]*line)"
>
> print re.search(b, a,re.MULTILINE).gro
Hi,
yes:
import re
a="""
I Am
Multiline
but short anyhow"""
b="(I[\s\S]*line)"
print re.search(b, a,re.MULTILINE).group(1)
gives
I Am
Multiline
Be aware that . matches NO newlines!!!
May be this caused your problems?
regards
Holger
Zdenek Maxa wrote:
> [EMAIL PROTECTED] wrote:
On May 29, 11:03 am, Zdenek Maxa <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I would like to perform regular expression replace (e.g. removing
> everything from within tags in a XML file) with multiple-line pattern.
> How can I do this?
>
> where = open("filename").read()
> multilinePattern = "^
> Od: Zdenek Maxa <[EMAIL PROTECTED]>
> Předmět: Re: multiline regular expression (replace)
> Datum: 29.5.2007 13:46:32
>
> [EMAIL PROTECTED] wrote:
> > On May 29, 2:03 am, Zdenek Maxa <[EMAIL PROTECTED]> wrote:
> >
Zdenek Maxa wrote:
> [EMAIL PROTECTED] wrote:
>> On May 29, 2:03 am, Zdenek Maxa <[EMAIL PROTECTED]> wrote:
>>
>>> Hi all,
>>>
>>> I would like to perform regular expression replace (e.g. removing
>>> everything from within tags in a XML file) with multiple-line pattern.
>>> How can I do this?
>
[EMAIL PROTECTED] wrote:
> On May 29, 2:03 am, Zdenek Maxa <[EMAIL PROTECTED]> wrote:
>
>> Hi all,
>>
>> I would like to perform regular expression replace (e.g. removing
>> everything from within tags in a XML file) with multiple-line pattern.
>> How can I do this?
>>
>> where = open("filename"
On May 29, 2:03 am, Zdenek Maxa <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I would like to perform regular expression replace (e.g. removing
> everything from within tags in a XML file) with multiple-line pattern.
> How can I do this?
>
> where = open("filename").read()
> multilinePattern = "^ <
"abcd" <[EMAIL PROTECTED]> writes:
> When do I need to use a trailing slash to separate code over multiple
> lines.
>
> For example:
>
> x = "hello world, this is my multiline " + \
> "string"
You can either do that, or you can use parentheses:
x = ( "foo" +
"bar" )
Note
Steve Holden <[EMAIL PROTECTED]> wrote:
> x = "hello world, this is my multiline " \
> "string"
>
> and this would have saved you a run-time string concatenation :)
or use parentheses for an alternative which doesn't need the backslash:
x = ("hello world, this is my multiline "
On Thursday 15 March 2007 15:57, abcd wrote:
> When do I need to use a trailing slash to separate code over multiple
> lines.
>
> For example:
>
> x = "hello world, this is my multiline " + \
> "string"
Needed. Although you can omit the "+".
> x = {'name' : \
> 'bob'}
Not needed b
abcd a écrit :
> When do I need to use a trailing slash to separate code over multiple
> lines.
>
> For example:
>
> x = "hello world, this is my multiline " + \
> "string"
Here you don't need the +
> x = {'name' : \
> 'bob'}
And here you don't need the antislash
> Do I need to
abcd wrote:
> When do I need to use a trailing slash to separate code over multiple
> lines.
>
> For example:
>
> x = "hello world, this is my multiline " + \
> "string"
Yes.
>
> x = {'name' : \
> 'bob'}
No.
You don't need trailing slashes whenever there's a pair of {}, [] or
abcd wrote:
> When do I need to use a trailing slash to separate code over multiple
> lines.
>
> For example:
>
> x = "hello world, this is my multiline " + \
> "string"
>
> x = {'name' : \
> 'bob'}
>
> Do I need to use the "\" in the above examples? When do i need to use
> it?
abcd wrote:
> When do I need to use a trailing slash to separate code over multiple
> lines.
>
> For example:
>
> x = "hello world, this is my multiline " + \
> "string"
>
> x = {'name' : \
> 'bob'}
>
> Do I need to use the "\" in the above examples? When do i need to use
> it?
On Wed, 10 May 2006 15:50:38 GMT in comp.lang.python, John Salerno
<[EMAIL PROTECTED]> wrote:
>Dave Hansen wrote:
>
> print textwrap.dedent(s).strip().replace('\n',' ')
>> this is a multiline triple-quted string with indentation for nicer
>> code formatting
>
>But I have some newlines that are
Dave Hansen wrote:
print textwrap.dedent(s).strip().replace('\n',' ')
> this is a multiline triple-quted string with indentation for nicer
> code formatting
But I have some newlines that are already embedded in the string, and I
wouldn't want those replaced.
--
http://mail.python.org/mailm
On Wed, 10 May 2006 13:56:52 GMT in comp.lang.python, John Salerno
<[EMAIL PROTECTED]> wrote:
>bruno at modulix wrote:
>
>> Why not trying by yourself ?-)
>
>Doh! I always forget I can do this! :)
>
>
>> Mmm. Not good. Let's try again:
> print textwrap.dedent(s).strip()
>> this is a multiline
bruno at modulix wrote:
> Why not trying by yourself ?-)
Doh! I always forget I can do this! :)
> Mmm. Not good. Let's try again:
print textwrap.dedent(s).strip()
> this is a multiline
> triple-quted string with
> indentation for nicer code formatting
>
> Well, seems like we're done. Abou
John Salerno wrote:
> Gary Herron wrote:
>
>> Gary John Salerno wrote:
>>
>>> How do you make a single string span multiple lines, but also allow
>>> yourself to indent the second (third, etc.) lines so that it lines up
>>> where you want it, without causing the newlines and tabs or spaces to
>>>
Gary Herron wrote:
> Gary John Salerno wrote:
>
>> How do you make a single string span multiple lines, but also allow
>> yourself to indent the second (third, etc.) lines so that it lines up
>> where you want it, without causing the newlines and tabs or spaces to be
>> added to the string as w
Gary John Salerno wrote:
>How do you make a single string span multiple lines, but also allow
>yourself to indent the second (third, etc.) lines so that it lines up
>where you want it, without causing the newlines and tabs or spaces to be
>added to the string as well?
>
>Example (pretend this i
Scott David Daniels wrote:
> John Salerno wrote:
>> How do you make a single string span multiple lines, but also allow
>> yourself to indent the second ... without causing the newlines and
>> tabs or spaces to be added to the string as well?
> >
>> self.DTD = '''>"http://www.w3.org/
John Salerno wrote:
> How do you make a single string span multiple lines, but also allow
> yourself to indent the second ... without causing the newlines and
> tabs or spaces to be added to the string as well?
>
> self.DTD = '''"http://www.w3.org/TR/html4/strict.dtd";>\n\n'''
>
> .
On Tue, May 09, 2006 at 05:38:52PM +, John Salerno wrote:
> How do you make a single string span multiple lines, but also allow
> yourself to indent the second (third, etc.) lines so that it lines up
> where you want it, without causing the newlines and tabs or spaces to be
> added to the st
Sion Arrowsmith wrote:
> It appears to me that our fundamental difference is that you see value
> in long-term preservation of sections of commented-out code without
> any kind of real comment as to what's going on, whereas I consider
> this to be appallingly bad practice.
Then you're reading too
Edward Elliott <[EMAIL PROTECTED]> wrote:
>Sion Arrowsmith wrote:
>> Really? Under what circumstances is it easier to see what's going on
>> with start/end comments than with comment-to-end-of-line?
>Off the top of my head:
> [ ... ]
It appears to me that our fundamental difference is that you se
"OKB (not okblacke)" <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> > If your revision control system is so inconvenient to use that
> > you'd rather have large blocks of commented-out code, it's time to
> > start using a better RCS -- perhaps a distributed one, so you can
> > commit to your ow
Ben Finney wrote:
> Indeed. Using revision control means never needing to comment out
> blocks of code.
>
> If your revision control system is so inconvenient to use that you'd
> rather have large blocks of commented-out code, it's time to start
> using a better RCS -- perhaps a distributed one,
rx wrote:
> Still a little strange to newcomers that there are three ways to do the
> same and that you should be carefull to use the right '''/""" inside the
> comment else the comment will not work for some reason.
>
> #comment
>
> '''
> comment
> '''
>
> """
> comment
> """
Please, note tha
"Jorge Godoy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> rx wrote:
>
>> I don't understand the problem - why should comments (and I hope you
>> believe there should be a one line comment at least) be restricted to one
>> line. It doesn't work that way for if, while, for.
>
> It
>
> Of course! You should have used """ since you already used ''' in your
> triple-quoted text. But I'm just repeating what I already said (and kept
> above so that you can see it again).
>
> --
> Jorge Godoy <[EMAIL PROTECTED]>
>
Sorry - I should have read more carefully.
I like the ide
rx wrote:
> I don't understand the problem - why should comments (and I hope you
> believe there should be a one line comment at least) be restricted to one
> line. It doesn't work that way for if, while, for.
It is the minimum case that can solve a problem commenting one line -- or
part of it as
"Jorge Godoy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> rx wrote:
>
>> I have commented out a lot of C++ code and miss the block feature in
>> python more than I missed the nested comments in C++.
>> Besides nothing really strange happened.
>> Sometimes you just need to diss
rx wrote:
>
> "Jorge Godoy" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Edward Elliott wrote:
>>
>
>>
>> You can use either """ or '''. I don't keep changing them in my code, so
>> I
>> can always use the other type (usually I use " so for commenting things
>> out
>> I'd us
rx wrote:
> I have commented out a lot of C++ code and miss the block feature in
> python more than I missed the nested comments in C++.
> Besides nothing really strange happened.
> Sometimes you just need to dissable some of the code temporarly as quickly
> as possible, and I like that it is not
Jorge Godoy wrote:
> You can use either """ or '''. I don't keep changing them in my code, so I
> can always use the other type (usually I use " so for commenting things out
> I'd use ') to do that.
It's close, only problem is it doesn't nest. It'll have to be good enough
for now.
>>Forcing p
Peter Tillotson wrote:
> discouraged except where vital. Perhaps we should make them really hard
> and elegant - mandate latex/mathml markup so good editors can display
> the equations we are implementing :-)
I like this guy already! :)
--
http://mail.python.org/mailman/listinfo/python-list
>
> Also, if you remove the start of the block first, then your editor might
> not
> be highlighting anymore... With nested comments things get even worse
> because you might miss the end of the outer block or something like that.
>
> --
> Jorge Godoy <[EMAIL PROTECTED]>
>
I have commente
Jorge Godoy wrote:
> Edward Elliott wrote:
> Try using Subversion. You can work and make diffs disconnected from the
> network.
rcs isn't the issue. I'm already assuming a local store, a networked one
just makes my argument even easier.
>>I'm not saying nested comments solve every problem, jus
Sion Arrowsmith wrote:
> Jorge Godoy <[EMAIL PROTECTED]> wrote:
>>Is it harder to remove "n" lines of code commented out with "#" than "n"
>>lines of multiline commented code? How?
>
> I'd say it's harder to remove the latter, due to having to search for
> the end of comment sequence, rather tha
"Jorge Godoy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Edward Elliott wrote:
>
>
> You can use either """ or '''. I don't keep changing them in my code, so
> I
> can always use the other type (usually I use " so for commenting things
> out
> I'd use ') to do that.
>
Try
Sion Arrowsmith wrote:
> Really? Under what circumstances is it easier to see what's going on
> with start/end comments than with comment-to-end-of-line?
Off the top of my head:
1. The code is usually easier to read as # can obscure the first token on
the line. This can be alleviated by leaving
"Edward Elliott" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ben Finney wrote:
>> Indeed. Using revision control means never needing to comment out
>> blocks of code.
>
> Typing (* and *) on a few line will always be quicker, easier, and less
> confusing than any rcs diffs/rest
Sion Arrowsmith wrote:
> I'd say it's harder to remove the latter, due to having to search for
> the end of comment sequence, rather than simply looking for where the
> block comment stops. And you've extra problems if you allow nested
> comments, because then you'll have to count how deep you've
Jorge Godoy <[EMAIL PROTECTED]> wrote:
>Is it harder to remove "n" lines of code commented out with "#" than "n"
>lines of multiline commented code? How?
I'd say it's harder to remove the latter, due to having to search for
the end of comment sequence, rather than simply looking for where the
bl
Edward Elliott <[EMAIL PROTECTED]> wrote:
>On top of that, the expressive power of nested comments seems greater than
>an endless string of ^#s. Sometimes it's just easier to see what's going on.
Really? Under what circumstances is it easier to see what's going on
with start/end comments than w
nice one Jorge :-)
Jorge Godoy wrote:
> Peter Tillotson wrote:
>
>> I'm not sure I agree, revision control is great but not the only answer.
>> In multi-developer teams working on the trunk, it its kind of
>> inconvenient if someone checks in broken code. It also blocks critical
>
> This is some
Edward Elliott wrote:
> And when the section I want to comment out contains a legit doc string in
> the middle, triple-quotes won't work. There are valid reasons to nest
You can use either """ or '''. I don't keep changing them in my code, so I
can always use the other type (usually I use " so
Peter Tillotson wrote:
> I'm not sure I agree, revision control is great but not the only answer.
> In multi-developer teams working on the trunk, it its kind of
> inconvenient if someone checks in broken code. It also blocks critical
This is something that should be a policy: no untested and wor
Edward Elliott wrote:
> Sure they can be abused. So can a thousand other language features. My
> point is you can't teach good coding through syntax, and trying to causes
> more problems than it solves.
I like the phrase: there are some languages that incentivates bad practices
in programming;
Edward Elliott wrote:
> Typing (* and *) on a few line will always be quicker, easier, and less
> confusing than any rcs diffs/restores. Once you delete the code you can
> no longer see it or add pieces back in without retrieving it from an
> external store.
Try using Subversion. You can work a
Ben Finney wrote:
> "Atanas Banov" <[EMAIL PROTECTED]> writes:
>
>> Edward Elliott wrote:
>>> Saying coders shouldn't use multiline comments to disable code
>>> misses the point. Coders will comment out code regardless of the
>>> existence of multiline comemnts. There has to be a better
>>> argu
Edward Elliott schrieb:
> On top of that, the expressive power of nested comments seems greater
> than an endless string of ^#s. Sometimes it's just easier to see what's
> going on.
not if you are using grep
--
Gregor
http://www.gregor-horvath.com
--
http://mail.python.org/mailman/listinfo/py
Duncan Booth wrote:
> Want to comment out a block of code in C++? The only (nearly) reliable way
> is to insert single-line comments down the block. You can't use a block
> comment if there are any other block comments inside the code you want to
> block out.
As Roel said, #if 0 is the standard
Duncan Booth schreef:
> Would you care to name a few languages which support nested block
> comments? There really aren't many: ML as you mentioned; Standard Pascal
> doesn't permit nesting of comments but *some* implementations do allow it.
>
> Want to comment out a block of code in C++? The onl
Edward Elliott wrote:
> Ben Finney wrote:
>> Indeed. Using revision control means never needing to comment out
>> blocks of code.
>
> Typing (* and *) on a few line will always be quicker, easier, and
> less confusing than any rcs diffs/restores. Once you delete the code
> you can no longer see
In article <[EMAIL PROTECTED]>,
Edward Elliott <[EMAIL PROTECTED]> wrote:
>ML has a
>very elegant system for nested comments with (* and *).
Which, if you mistype an opening or closing comment symbol, can lead to
some very mysterious syntax errors.
--
http://mail.python.org/mailman/listinfo/p
Ben Finney wrote:
> Indeed. Using revision control means never needing to comment out
> blocks of code.
Typing (* and *) on a few line will always be quicker, easier, and less
confusing than any rcs diffs/restores. Once you delete the code you can no
longer see it or add pieces back in without
Ben Finney wrote:
> And/or switch to an editor that can perform editing operations on a
> range of lines.
I'm not unsympathetic to this point of view, as I would feel hamstrung
without my vim. It's more that I object to the paternalism of telling
people they have to use such an editor. There a
Atanas Banov wrote:
> want to comment block of code? use tripple-quotes. does not nest? ahhh,
> maybe it's time to get rid of that block you commented out a month ago
> "just in case the new code doesnt work".
>
> that gives you incentive to tidy up. don't be a code slob... don't
> leave a mess fo
"Atanas Banov" <[EMAIL PROTECTED]> writes:
> Edward Elliott wrote:
> > Saying coders shouldn't use multiline comments to disable code
> > misses the point. Coders will comment out code regardless of the
> > existence of multiline comemnts. There has to be a better
> > argument for leaving them o
Edward Elliott wrote:
> At the risk of flogging a dead horse, I'm wondering why Python doesn't have
> any multiline comments. One can abuse triple-quotes for that purpose, but
> that's obviously not what it's for and doesn't nest properly.
...
> Saying coders shouldn't use multiline comments to d
James Stroud <[EMAIL PROTECTED]> writes:
> Edward Elliott wrote:
> > At the risk of flogging a dead horse, I'm wondering why Python
> > doesn't have any multiline comments. [...]
> >
> > Using an editor to throw #s in front of every line has
> > limitations. Your editor has to support it and you
1 - 100 of 114 matches
Mail list logo