![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Matthias Bussonnier <bussonniermatthias@gmail.com> added the comment: 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. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33477> _______________________________________