no inline comments

  • Thread starter Tomasz Stochmal
  • Start date
T

Tomasz Stochmal

Hi


I have been using Python for the past 2 years in commercial environment

One lacking feature is inline comments like in C /* this is comnment */

What is a chance of introducing it to next release of Python ?


Regards,
Tom
 
L

Lawrence Oluyede

In data 7 Mar 2004 10:13:46 -0800, Tomasz Stochmal ha scritto:
One lacking feature is inline comments like in C /* this is comnment */

What is a chance of introducing it to next release of Python ?

What do you mean? You can use the triple quote:

"""
This is a multiline
inline comment
"""
 
J

John Roth

Lawrence Oluyede said:
In data 7 Mar 2004 10:13:46 -0800, Tomasz Stochmal ha scritto:


What do you mean? You can use the triple quote:

"""
This is a multiline
inline comment
"""

That's not a comment. It's a string. Try putting
it in the middle of another statement and you'll
see the difference.

The reason it looks like a comment is that a string,
all by itself, is a perfectly valid expression, so you
can put one wherever you could put a statement.

John Roth
 
J

John Roth

Tomasz Stochmal said:
Hi


I have been using Python for the past 2 years in commercial environment

One lacking feature is inline comments like in C /* this is comnment */

What is a chance of introducing it to next release of Python ?

To get something like that into Python you need to

1) get some enthusiasm behind it here

2) submit a proposal (called a PEP) with a use
case that shows that the feature is worth more than
the code needed to make it work,

and 3) submit the code.

My own personal feeling goes along with the XP
crowd. A comment is a slight code smell: it says that
the code itself is not as expressive as it needs to be.

There are times when a comment is undoubtedly
justified, but I'd be more inclined to ask whether I
could fix the code so I didn't need the comment,
rather than whether I could fix the language so I could
comment better.

John Roth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top