Content deleted Content added
Line 260:
The compiler will throw a SyntaxError at "Hi foo()" because it thinks that is the code. Ok badly phrased, but the essence is that commenting using docstrings is bad. :) [[User:Eric B. and Rakim|Eric B. and Rakim]] 02:55, 14 Jan 2005 (UTC)
:That is not a problem with Python docstrings specifically, but with nested open/close-marked comment in general. Consider the following C example:
/*
int function()
{
/* Returns 0*/
return 0;
}
*/
:In fact, Python gives even you a way to avoid the problem; using <nowiki>'''</nowiki> for the outer comment.
:The statement as it stands is too vague as it does not explain "wont work", and as explained above inaccurate. In fact I don't think it's worth mentioning at all, because it is a trivial syntax error. You also get a syntax error if you nest parentheses incorrectly, but we don't mention that -- for good reasons. [[User:Fredrik|Fredrik]] | [[User talk:Fredrik|talk]] 00:33, 16 Jan 2005 (UTC)
|