Add more examples for docs demo, including a long parameter description.

This commit is contained in:
chebee7i 2013-11-05 13:10:39 -06:00
parent c9c132ad09
commit bee3ee99ba
2 changed files with 31 additions and 5 deletions

View File

@ -18,11 +18,11 @@ Here is another:
.. math:: .. math::
\nabla^2 f = \nabla^2 f =
\frac{1}{r^2} \frac{\partial}{\partial_r} \frac{1}{r^2} \frac{\partial}{\partial r}
\left( r^2 \frac{\partial f}{\partial_r} \right) + \left( r^2 \frac{\partial f}{\partial r} \right) +
\frac{1}{r^2 \sin \theta} \frac{\partial f}{\partial_\theta} \frac{1}{r^2 \sin \theta} \frac{\partial f}{\partial \theta}
\left( \sin \theta \, \frac{\partial f}{\partial_\theta} \right) + \left( \sin \theta \, \frac{\partial f}{\partial \theta} \right) +
\frac{1}{r^2 \sin^2\theta} \frac{\partial^2 f}{\partial_\phi^2} \frac{1}{r^2 \sin^2\theta} \frac{\partial^2 f}{\partial \phi^2}
API Test API Test
======== ========

View File

@ -75,3 +75,29 @@ class Foo:
""" """
return myvalue.upper() return myvalue.upper()
def another_function(self, a, b, **kwargs):
"""
Here is another function.
:param a: The number of green hats you own.
:type a: int
:param b: The number of non-green hats you own.
:type b: int
:param kwargs: Additional keyword arguments. Each keyword parameter
should specify the name of your favorite cuisine.
The values should be floats, specifying the mean price
of your favorite dish in that cooking style.
:type kwargs: float
:returns: A 2-tuple. The first element is the mean price of all dishes
across cuisines. The second element is the total number of
hats you own: :math:`a + b`.
:rtype: tuple
:raises ValueError: When ``a`` is not an integer.
"""
return sum(kwargs.values()) / len(kwargs), a + b