def func(path, field_storage, temporary):
'''基本描述
详细描述
:param path: The path of the file to wrap
:type path: str
:param field_storage: The :class:`FileStorage` instance to wrap
:type field_storage: FileStorage
:param temporary: Whether or not to delete the file when the File instance is destructed
:type temporary: bool
:returns: A buffered writable file descriptor
:rtype: BufferedFileStorage
'''
pass
def func(path, field_storage, temporary):
'''基本描述
详细描述
Parameters
----------
path : str
The path of the file to wrap
field_storage : FileStorage
The :class:`FileStorage` instance to wrap
temporary : bool
Whether or not to delete the file when the File instance is destructed
Returns
-------
BufferedFileStorage
A buffered writable file descriptor
'''
pass
def func(path, field_storage, temporary):
'''基本描述
详细描述
Args:
path (str): The path of the file to wrap
field_storage (FileStorage): The :class:`FileStorage` instance to wrap
temporary (bool): Whether or not to delete the file when the File instance is destructed
Returns:
BufferedFileStorage: A buffered writable file descriptor
'''
pass
中文版:https://www.osgeo.cn/sphinx/usage/extensions/napoleon.html
英文版:https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html
风格 | 特点 | 适用 |
---|---|---|
reStructuredText | 用冒号分隔 | PyCharm默认 |
NumPy | 用下划线分隔 | 倾向垂直,长而深的文档 |
用缩进分隔 | 倾向水平,短而简单的文档 |
Python风格规范 — Google 开源项目风格指南
Sphinx入门——快速生成Python文档
Sphinx是Python文档生成器
from PIL import Image
im = Image.open('Me.jpg') # type: Image.Image
from PIL import Image
im = Image.open('Me.jpg')
""":type: Image.Image"""
from PIL import Image
im = Image.open('Me.jpg')
assert isinstance(im, Image.Image)