Matthias Bussonnier <bussonniermatth...@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 <rep...@bugs.python.org> <https://bugs.python.org/issue33477> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com