4 ms·
String literals without assignment have no side effect, that is why you think of them as comments. They are however, not comments. They are parsed and interpret
by dotancohen 10y ago
String literals without assignment have no side effect, that is why you think of them as comments. They are however, not comments. They are parsed and interpreted just like any other string.
You might be familiar with the concept in Javascript, if you have ever put 'use strict' at the top of a JS file.
- thewhitetulip 10y agoTrue, they are not strings and I'll update it to mention that specifically, we should not be abusing strings :-) thank you
- jamiesonbecker 10y agoWell, they are strings.. they're just multi-line strings..
- thewhitetulip 10y agoYes, I wanted to use "comments" instead of strings :D
- Jugurtha 10y agoI think thewhitetulip has GvR's blessing[0]. It makes sense, though: There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. The guy's handle is thewhitetulip, which is the most Dutch thing I can think of. [0]: https://twitter.com/gvanrossum/status/112670605505077248 https://twitter.com/gvanrossum/status/112670605505077248
- thewhitetulip 10y agoI am not Dutch, the handle is thewhitetulip because of a TV show called Fringe, where in the protagonist asks God for a sign of forgiveness, a white tulip.
- xapata 10y agoFunny, I guess he's changed his mind.
- thewhitetulip 10y agoWhat's so funny? I made a mistake and you and the others pointed it out & I fixed it. Plus, triple quoted strongs are either strings or docstrings not comments, isn't rectifying mistakes good?
- xapata 10y agoHmm? I was talking about Guido changing his mind. I guess it was an ambiguous pronoun reference. Sorry about that.