CASA Python Coding Standards

Adopted Standards

Proposed Standards

General Python Coding Standards

  1. Python PEP 8

Python Docstring Coding Standards

  1. Python PEP 257

Adopted Exceptions

Proposed Exceptions

  1. Exception to PEP 257, proposed by Rob Reid

Section "Multi-line Docstrings", paragraph 4", reads:

The docstring for a module should generally list the classes, exceptions and functions (and any other objects) that are exported by the module, with a one-line summary of each. (These summaries generally give less detail than the summary line in the object's docstring.) The docstring for a package (i.e., the docstring of the package's init.py module) should also list the modules and subpackages exported by the package.

Quoting Rob:

That seems like a mistake. We should be (and are) able to add things to modules and modules to packages without updating a global list of them. Such lists are prone to being out of date, and thus make unreliable documentation. IMHO it's better to

import mod
mod.<TAB>
mod.interesting_thing?

to see what's there.

-- ScottRankin - 2011-07-12
Topic revision: r1 - 2011-07-12, ScottRankin
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback