D
dmh2000
I recently complained elsewhere that Python doesn't have multiline
comments. i was told to use triple quoted strings to make multiline
comments. My question is that since a triple quoted string is actually
a language construct, does it use cause a runtime construction of a
string which is then discarded, or is the runtime smart enough to see
that it isn't used and so it doesn't construct it?
example
def fun(self):
"""doc comment
comment line 2
"""
x = 1
y = 2
"""does this triple quoted string used as a comment
cause something to happen at runtime beyond
just skipping over it? Such as allocation of memory for a string
or worse yet garbage collection? or not?
"""
z = x + y
....
dave howard
comments. i was told to use triple quoted strings to make multiline
comments. My question is that since a triple quoted string is actually
a language construct, does it use cause a runtime construction of a
string which is then discarded, or is the runtime smart enough to see
that it isn't used and so it doesn't construct it?
example
def fun(self):
"""doc comment
comment line 2
"""
x = 1
y = 2
"""does this triple quoted string used as a comment
cause something to happen at runtime beyond
just skipping over it? Such as allocation of memory for a string
or worse yet garbage collection? or not?
"""
z = x + y
....
dave howard