Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > no inline comments

Reply
Thread Tools

no inline comments

 
 
Tomasz Stochmal
Guest
Posts: n/a
 
      03-07-2004
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
 
Reply With Quote
 
 
 
 
Lawrence Oluyede
Guest
Posts: n/a
 
      03-07-2004
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
"""


--
Lawrence
"Avevo Halo, poi arrivato Zelda... e ho buttato Halo."
 
Reply With Quote
 
 
 
 
John Roth
Guest
Posts: n/a
 
      03-07-2004

"Lawrence Oluyede" <(E-Mail Removed)> wrote in message
news:s5ovemxbkt98$.13eip0ev07e55$(E-Mail Removed).. .
> 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
> """


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
>
>
> --
> Lawrence
> "Avevo Halo, poi arrivato Zelda... e ho buttato Halo."



 
Reply With Quote
 
John Roth
Guest
Posts: n/a
 
      03-07-2004
"Tomasz Stochmal" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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

>
>
> Regards,
> Tom



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tool which expands implicitly inline inline functions tthunder@gmx.de C++ 3 06-16-2005 12:54 AM
To inline or not to inline? Alvin C++ 7 05-06-2005 03:04 PM
Function delcared inline but not defined inline Nish C Programming 4 10-08-2004 03:31 PM
External inline functions calling internal inline functions Daniel Vallstrom C Programming 2 11-21-2003 01:57 PM
inline or not to inline in C++ Abhi C++ 2 07-03-2003 12:07 AM



Advertisments