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.

Author mbussonn
Recipients docs@python, mbussonn, methane
Date 2018-05-18.17:02:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526662924.85.0.682650639539.issue33477@psf.upfronthosting.co.za>
In-reply-to
Content
Fair enough that what's new include things about Module


> The first statement in their body is not considered as a docstring anymore.

Note that this sentence read backward to me. I understand what is meant because I know the new behavior. It might be good to clarify. potentially:

> The first statement in the `body` attribute of should not be considered the docstring of the module anymore, the `docstring` attribute  is reserved for that.


Though the documentation of `compile()` does not say that `compile(...,'exec')` compile a module. It says:

> The mode argument specifies what kind of code must be compiled;
> it can be 'exec' if source consists of a sequence of statements

Which now is incorrect. I was expecting `compile(..., 'exec')` to return a Module with `None` or empty string as the docstring attribute – which is also a perfectly reasonable request.

I think that `compile`  documentation should be changed to reflect what it does. 


Or (but I see why this is un-reasonable) split add the `mode='module'` that has new behavior, while `exec` does not.
History
Date User Action Args
2018-05-18 17:02:04mbussonnsetrecipients: + mbussonn, methane, docs@python
2018-05-18 17:02:04mbussonnsetmessageid: <1526662924.85.0.682650639539.issue33477@psf.upfronthosting.co.za>
2018-05-18 17:02:04mbussonnlinkissue33477 messages
2018-05-18 17:02:04mbussonncreate