ExampleClass#

class examples.samples.ExampleClass(param1, param2, param3=0)#

The summary line for a class docstring should fit on one line.

Attributes should be documented inline with the attribute’s declaration.

Properties created with the @property decorator should be documented in the property’s getter method.

Parameters:
param1str

Description of param1.

param2list of str

Description of param2. Multiple lines are supported.

param3int, optional

Description of param3.

Examples

An example of how to initialize this class should be given.

>>> from ansys_sphinx_theme import samples
>>> example = samples.ExampleClass('mystr', ['apple', 'orange'], 3)

Overview#

example_method

Class methods are similar to regular functions.

readonly_property

Properties should be documented in their getter method.

readwrite_property

Set or return the readwrite property.

__special__

By default special members with docstrings are not included.

__special_without_docstring__

Import detail#

from examples.samples import ExampleClass

Property detail#

property ExampleClass.readonly_property: str#

Properties should be documented in their getter method.

Examples

>>> example.readonly_property
"readonly_property"
property ExampleClass.readwrite_property#

Set or return the readwrite property.

Properties with both a getter and setter should only be documented in their getter method.

If the setter method contains notable behavior, it should be mentioned here.

Examples

>>> example.readwrite_property
"readwrite_property"
>>> example.readwrite_property = 'hello world'
>>> example.readwrite_property
'hello world'

Attribute detail#

ExampleClass.attr1#
ExampleClass.attr2#
ExampleClass.attr3#
ExampleClass.attr4 = ['attr4']#
ExampleClass.attr5 = None#

Method detail#

ExampleClass.example_method(param1, param2)#

Class methods are similar to regular functions.

Parameters:
param1str

The first parameter.

param2str

The second parameter.

Returns:
bool

True if successful, False otherwise.

Notes

Do not include the self parameter in the Parameters section.

Examples

>>> example.example_method('foo', 'bar')
True
ExampleClass.__special__()#

By default special members with docstrings are not included.

Special members are any methods or attributes that start with and end with a double underscore. Any special member with a docstring will be included in the output, if napoleon_include_special_with_doc is set to True.

This behavior can be enabled by changing the following setting in Sphinx’s conf.py:

napoleon_include_special_with_doc = True
ExampleClass.__special_without_docstring__()#