google_docstring_example.ExampleClass Class Reference
Inheritance diagram for google_docstring_example.ExampleClass:

Public Member Functions

def __init__
 
def example_method
 
def __special__
 
def __special_without_docstring__
 

Public Attributes

 attr1
 
 attr2
 
 attr3
 

Detailed Description

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

If the class has public attributes, they should be documented here
in an ``Attributes`` section and follow the same formatting as a
function's ``Args`` section.

Attributes:
  attr1 (str): Description of `attr1`.
  attr2 (list of str): Description of `attr2`.
  attr3 (int): Description of `attr3`.

Constructor & Destructor Documentation

def google_docstring_example.ExampleClass.__init__ (   self,
  param1,
  param2,
  param3 = 0 
)
Example of docstring on the __init__ method.

The __init__ method may be documented in either the class level
docstring, or as a docstring on the __init__ method itself.

Either form is acceptable, but the two should not be mixed. Choose one
convention to document the __init__ method and be consistent with it.

Note:
  Do not include the `self` parameter in the ``Args`` section.

Args:
  param1 (str): Description of `param1`.
  param2 (list of str): Description of `param2`. Multiple
    lines are supported.
  param3 (int, optional): Description of `param3`, defaults to 0.

References google_docstring_example.ExampleClass.attr1, google_docstring_example.ExampleClass.attr2, and google_docstring_example.ExampleClass.attr3.

151  def __init__(self, param1, param2, param3=0):
152  """Example of docstring on the __init__ method.
153 
154  The __init__ method may be documented in either the class level
155  docstring, or as a docstring on the __init__ method itself.
156 
157  Either form is acceptable, but the two should not be mixed. Choose one
158  convention to document the __init__ method and be consistent with it.
159 
160  Note:
161  Do not include the `self` parameter in the ``Args`` section.
162 
163  Args:
164  param1 (str): Description of `param1`.
165  param2 (list of str): Description of `param2`. Multiple
166  lines are supported.
167  param3 (int, optional): Description of `param3`, defaults to 0.
168 
169  """
170  self.attr1 = param1
171  self.attr2 = param2
172  self.attr3 = param3
attr3
Definition: google_docstring_example.py:171
def __init__
Definition: google_docstring_example.py:150
attr2
Definition: google_docstring_example.py:170
attr1
Definition: google_docstring_example.py:169

Member Function Documentation

def google_docstring_example.ExampleClass.__special__ (   self)
By default special members with docstrings are 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.

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

    napoleon_include_special_with_doc = False
190  def __special__(self):
191  """By default special members with docstrings are included.
192 
193  Special members are any methods or attributes that start with and
194  end with a double underscore. Any special member with a docstring
195  will be included in the output.
196 
197  This behavior can be disabled by changing the following setting in
198  Sphinx's conf.py::
199 
200  napoleon_include_special_with_doc = False
201 
202  """
203  pass
def __special__
Definition: google_docstring_example.py:189
def google_docstring_example.ExampleClass.example_method (   self,
  param1,
  param2 
)
Class methods are similar to regular functions.

Note:
  Do not include the `self` parameter in the ``Args`` section.

Args:
  param1: The first parameter.
  param2: The second parameter.

Returns:
  True if successful, False otherwise.
174  def example_method(self, param1, param2):
175  """Class methods are similar to regular functions.
176 
177  Note:
178  Do not include the `self` parameter in the ``Args`` section.
179 
180  Args:
181  param1: The first parameter.
182  param2: The second parameter.
183 
184  Returns:
185  True if successful, False otherwise.
186 
187  """
188  return True
def example_method
Definition: google_docstring_example.py:173

The documentation for this class was generated from the following file: