property Cells.doc#

Documentation string

doc is a property of Model, Space and Cells for setting and getting a string to document the object.

When a Model is written to files by write_model() or its variants, the docsting of the Model and UserSpace objects in the Model are written at the top of the __init__.py files as if they are the docstrings of Python modules.

The doc property of a Cells is linked to the docstring of its Formula if the Formula is not defined by a lambda function. When the doc property of a Cells is updated, then the docstring of the Cells’ Formula is also updated, and vice versa:

>>> foo.formula
def foo(x):
    """The docstring of foo"""
    return x

>>> foo.doc
'The docstring of foo'

>>> foo.doc = "The doc propery of foo"

>>> foo.formula
def foo(x):
    """The doc propery of foo"""
    return x

See also


Changed in version 0.14.0.