Next / Previous / Contents / TCC Help System / NM Tech homepage

4. The source code

The code for pyskip.py follows in literate programming style. The author is indebted to his colleague Dr. Allan M. Stavely for literate programming tools.

The development uses the Cleanroom or “zero-defect” methodology described in Dr. Stavely's book Toward Zero-Defect Programming (Addison-Wesley, 1999, ISBN 0-201-38595-3). The author's commenting conventions and other adaptations for Python practice are described online.

4.1. Declarations

We'll start with a rudimentary documentation string for the module, pointing back to the online documentation:

pyskip.py
"""pyskip.py:  A container class for ordered sets in Python.

    $Revision: 1.23 $  $Date: 2009/10/10 19:34:47 $

For documentation, see:
    http://www.nmt.edu/tcc/help/lang/python/examples/pyskip/    
"""

Next we'll need to import one of the Python standard modules, the random number generator:

pyskip.py
import random