Message317037
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. |
|
Date |
User |
Action |
Args |
2018-05-18 17:02:04 | mbussonn | set | recipients:
+ mbussonn, methane, docs@python |
2018-05-18 17:02:04 | mbussonn | set | messageid: <1526662924.85.0.682650639539.issue33477@psf.upfronthosting.co.za> |
2018-05-18 17:02:04 | mbussonn | link | issue33477 messages |
2018-05-18 17:02:04 | mbussonn | create | |
|