Why python docstring is interpreted differently from comment
问题 Let's say, I've got a function like this: def myFunc(): # useful function to calculate stuff This will produce an indentation error, unless I add pass : def myFunc(): # useful function to calculate stuff pass However, if I replace a comment with docstring, no pass is necessary: def myFunc(): """useful function to calculate stuff""" This seems like an odd feature as neither of these are used in the program, as far as I know. So, why does it behave like this? 回答1: A docstring isn't just a