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:
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#
Class methods are similar to regular functions. |
Properties should be documented in their getter method. |
|
Set or return the readwrite property. |
By default special members with docstrings are not included. |
|
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:
- Returns:
- bool
True
if successful,False
otherwise.
Notes
Do not include the
self
parameter in theParameters
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__()#