Module epytext_example |
[hide private]
[frames] | no frames]

# Source Code for Module epytext_example

     1  #
     2  # epytext_example.py
     3  #
     4  # Example code used by the epytext manual.
     5  #
     6  # These functions are used by epytextintro.html to illustrate epytext,
     7  # and show what output is generated by epydoc for a simple docstring.
     8  #
     9  """
    10  Examples for the epytext manual.
    11  """
    12  __docformat__='epytext'
    13
    14 -def x_intercept(m, b):
    15      """
    16      Return the x intercept of the line M{y=m*x+b}.  The X{x intercept}
    17      of a line is the point at which it crosses the x axis (M{y=0}).
    18
    19      This function can be used in conjuction with L{z_transform} to
    20      find an arbitrary function's zeros.
    21
    22      @type  m: number
    23      @param m: The slope of the line.
    24      @type  b: number
    25      @param b: The y intercept of the line.  The X{y intercept} of a
    26                line is the point at which it crosses the y axis (M{x=0}).
    27      @rtype:   number
    28      @return:  the x intercept of the line M{y=m*x+b}.
    29      """
    30      return -b/m
    31
    32 -def z_transform(f):
    33      """
    34      This is just an example; there is no z_transform function.
    35      """
    36      return f(12)
    37