Example::
在分节符和文字块之间需要一个双冒号和一个空行。
请参阅拿破仑文档中的示例:
"""Example Google style docstrings.
This module demonstrates documentation as specified by the `Google Python
Style Guide`_. Docstrings may extend over multiple lines. Sections are created
with a section header and a colon followed by a block of indented text.
Example:
Examples can be given using either the ``Example`` or ``Examples``
sections. Sections support any reStructuredText formatting, including
literal blocks::
$ python example_google.py
Section breaks are created by resuming unindented text. Section breaks
are also implicitly created anytime a new section starts.
"""
所以,在你的例子中,试试这个:
class Chicken(object):
"""Animal that lays egg and has feathers
Note:
Chickens love to eat feed
Example::
chicken.eats(feed)
"""