➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 methane
收信人 methane, vstinner
日期 2017-02-06.14:21:15
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1486390876.35.0.496966996959.issue29463@psf.upfronthosting.co.za>
In-reply-to
内容
spin off of #11549.

http://bugs.python.org/issue11549#msg130955

> b) Docstring is now an attribute of Module, FunctionDef and ClassDef, > rather than a first statement. Docstring is a special syntactic 
> construction, it's not an executable code, so it makes sense to separate it. Otherwise, optimizer would have to take extra care not to introduce, change or remove docstring. For example:
>
>  def foo():
>    "doc" + "string"
>
>Without optimizations foo doesn't have a docstring. After folding, however, the first statement in foo is a string literal. This means that docstring depends on the level of optimizations. Making it an attribute avoids the problem.
历史
日期 用户 动作 参数
2017-02-06 14:21:19methane修改recipients: + methane, vstinner
2017-02-06 14:21:16methane修改messageid: <1486390876.35.0.496966996959.issue29463@psf.upfronthosting.co.za>
2017-02-06 14:21:16methane链接issue29463 messages
2017-02-06 14:21:16methane创建