@@ -152,7 +152,7 @@ The directives are:
152152
153153 Describes global data in a module, including both variables and values used
154154 as "defined constants." Class and object attributes are not documented
155- using this environment .
155+ using this directive .
156156
157157.. describe :: exception
158158
@@ -165,7 +165,7 @@ The directives are:
165165 parameters, enclosing optional parameters in brackets. Default values can be
166166 given if it enhances clarity. For example::
167167
168- .. function:: Timer. repeat([repeat=3[, number=1000000]])
168+ .. function:: repeat([repeat=3[, number=1000000]])
169169
170170 Object methods are not documented using this directive. Bound object methods
171171 placed in the module namespace as part of the public interface of the module
@@ -217,13 +217,30 @@ The directives are:
217217
218218 Describes an object data attribute. The description should include
219219 information about the type of the data to be expected and whether it may be
220- changed directly.
220+ changed directly. This directive should be nested in a class directive,
221+ like in this example::
222+
223+ .. class:: Spam
224+
225+ Description of the class.
226+
227+ .. data:: ham
228+
229+ Description of the attribute.
230+
231+ If is also possible to document an attribute outside of a class directive,
232+ for example if the documentation for different attributes and methods is
233+ split in multiple sections. The class name should then be included
234+ explicitly::
235+
236+ .. data:: Spam.eggs
221237
222238.. describe :: method
223239
224240 Describes an object method. The parameters should not include the ``self ``
225241 parameter. The description should include similar information to that
226- described for ``function ``.
242+ described for ``function ``. This method should be nested in a class
243+ method, like in the example above.
227244
228245.. describe :: decoratormethod
229246
0 commit comments