Details
-
Type:
Improvement
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: Requirements Documents
-
Labels:
-
Story Points:0.25
-
Epic Link:
-
Sprint:Alert Production S17 - 4
-
Team:Alert Production
Description
The Python coding standards say that __all__ = ... should go after all imports:
https://developer.lsst.io/coding/python_style_guide.html#standard-code-order-should-be-followed
However, PEP8 specifically states in Module level dunder names that it should go before any imports except from __future__ import ....
In my opinion the PEP8 standard makes the code more readable (by advertising the public symbols right away) and I can't think of any good reason to violate it (other than past history). I suggest we updated our coding standards accordingly.
The bullet list at https://developer.lsst.io/coding/python_style_guide.html#standard-code-order-should-be-followed presently reads:
3. Module-level docstring
4. Imports
5. __all__ statement, if any
I suggest that instead it read:
3. Module-level docstring
4. from __future__ import absolute_import, division, print_function
5. __all__ statement, if any
6. Imports (other than "from __future__ import...", which must appear before "__all__ =...")