Cells.set_doc#
- Cells.set_doc(doc, insert_indents=False)[source]#
Set the
doc
propertyBy default,
set_doc()
works the same asCells.doc
property setter.If
doc
is a multi-line string andTrue
is passed to theinsert_indents
parameter, the second and subsequent lines ofdoc
are auto-indented.Example
This example shows how the docstring of a Cells can be set with or without indentation from an unindented string:
>>> @mx.defcells ... def foo(x): ... return x >>> doc = """This is foo ... ... multiple line docstring ... """ >>> foo.set_doc(doc) # Or foo.doc = doc >>> foo.formula def foo(x): """This is foo multiple line docstring """ return x >>> foo.set_doc(doc, insert_indents=True) >>> foo.formula def foo(x): """This is foo multiple line docstring """ return x
- Parameters:
See also
Added in version 0.14.0.