
It should be documented whether keyword arguments are part of the interface. The docstring for a function or method should summarize its behavior and document its arguments, return value(s), side effects, exceptions raised, and restrictions on when it can be called (all if applicable).


(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. 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. Usage messages can be fairly elaborate (several screens full) and should be sufficient for a new user to use the command properly, as well as a complete quick reference to all options and arguments for the sophisticated user. Such a docstring should document the script’s function and command line syntax, environment variables, and files. The docstring of a script (a stand-alone program) should be usable as its “usage” message, printed when the script is invoked with incorrect or missing arguments (or perhaps with a “-h” option, for “help”). The entire docstring is indented the same as the quotes at its first line. The summary line may be on the same line as the opening quotes or on the next line. The summary line may be used by automatic indexing tools it is important that it fits on one line and is separated from the rest of the docstring by a blank line. Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The one-line docstring should NOT be a “signature” reiterating the function/method parameters (which can be obtained by introspection) It prescribes the function or method’s effect as a command (“Do this”, “Return that”), not as a description The docstring is a phrase ending in a period. There’s no blank line either before or after the docstring The closing quotes are on the same line as the opening quotes. Triple quotes are used even though the string fits on one line. return lim_type end subroutine limiter_type NOTES: Subroutine limiter_type ( method_data ) ! Return the type of limiter. Global audience are encouraged to adopt a similar policy.

Provide a latin transliteration of their names. Authors whose names are not based on the latin alphabet MUST Only exceptions are (a) test cases testing the non-ASCII features, and (b) In addition, string literals and comments must also be in ASCII. (in many cases, abbreviations and technical terms are used which aren’tĮnglish). MUST use ASCII-only identifiers, and SHOULD use English words wherever feasible Standard library (see PEP 3131): All identifiers in the Python standard library NOTE: For Python 3.0 and beyond, the following policy is prescribed for the Method definitions inside a class are separated by a single blank line. Separate top-level function and class definitions with two blank lines.
Blank line simply fortran code#
Confine your line width to 80 characters, so that your code can be displayed on screen for side-by-side comparison and printed easily on A4 paper.įor flowing long blocks of text (docstrings or comments), limiting the length to 72 characters is recommended.
