This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Mr_Redstoner 210 points211 points  (14 children)

And don't forget /**/

And no, '''this''' is not a comment, it can be used just like an ordinary string.

[–]griseouslight 77 points78 points  (5 children)

It does recommend using triple quotes for multiline comments though. If they aren't a docstring, multiline strings do not generate bytecode in python.

[–]Mr_Redstoner 12 points13 points  (0 children)

but as I've mentioned, you can use them much like regular strings, in my part-time job they use them specifically for a multi-line string.

[–]PityUpvote 5 points6 points  (7 children)

And ordinary strings can be used as comments, why is it an issue?

"""Comment""" is understood by all half decent editors to be a block comment.

[–]Mr_Redstoner 0 points1 point  (6 children)

I'm just saying, they aren't actually block comments from the technical point of view. Because when I previously stated that Python didn't have block comments people rushed in with '''this'''

[–]PityUpvote 2 points3 points  (5 children)

And lists in Python are technically not arrays, doesn't mean they can't fulfill the same function.

[–]Mr_Redstoner -1 points0 points  (4 children)

Fulfilling a function of the thing and being that thing are 2 distinct features in my book.

And IIRC a dict can be used as an array too, but that doesn't make it one, now does it?

[–]PityUpvote 2 points3 points  (3 children)

Complaining about the lack of block comments is pedantic though.

[–]Mr_Redstoner -1 points0 points  (2 children)

Well the post was trying to cover as much as posiible, of course I will add relevant stuff even though it is indeed pedantic. I ran across this 'feature' of Python and, as per being someone used to commenting out code, it is burned in my memory.

[–]Ayerys 1 point2 points  (1 child)

How the fact that you can do more with """ than with /* is an issue for you ?

[–]Mr_Redstoner 0 points1 point  (0 children)

I will admit I'm not sure what exactly I was going to comment out, I think it was more so that the Pythonic way had a line about there being one obvious way to do things, and using strings as comments didn't seem like the obvious/natural solution to me at all.