Cells.set_doc#
- Cells.set_doc(doc, insert_indents=False)[source]#
Set the
docpropertyBy default,
set_doc()works the same asCells.docproperty setter.If
docis a multi-line string andTrueis passed to theinsert_indentsparameter, the second and subsequent lines ofdocare 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.