Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
openEuler-Advisor
提交
0828e222
O
openEuler-Advisor
项目概览
openeuler
/
openEuler-Advisor
通知
32
Star
4
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openEuler-Advisor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0828e222
编写于
6月 30, 2020
作者:
J
jiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
The annotation specification follows Google open source project and python style specification
上级
e6e24492
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
83 addition
and
0 deletion
+83
-0
packageship/packageship/annotation_specifications.py
packageship/packageship/annotation_specifications.py
+83
-0
未找到文件。
packageship/packageship/annotation_specifications.py
0 → 100644
浏览文件 @
0828e222
"""
description: Function and class annotation specifications in the project
functions: test
"""
# py文件中,如果全部为函数,顶部信息格式如上,description填写描述信息,functions填写函数名称
# Args:
# 列出每个参数的名字, 并在名字后使用一个冒号和一个空格,
# 分隔对该参数的描述.如果描述太长超过了单行80字符,使用2或者4个空格的悬挂缩进(与文件其他部分保持一致).
# 描述应该包括所需的类型和含义.
# Returns:
# 描述返回值的类型和语义. 如果函数返回None, 这一部分可以省略.
# Raises:
# 可能产生的异常
def
test
(
name
,
age
):
"""
Description: Function description information
Args:
name: name information
age: age information
Returns:
Returned information
Raises:
IOError: An error occurred accessing the bigtable.Table object.
"""
name
=
'tom'
age
=
11
return
name
,
age
# description: Function and class annotation specifications in the project
# class: SampleClass
# py文件中,如果全部为类,顶部信息格式如上,description填写描述信息,class填写类名称,用 三引号,不用#
# 类应该在其定义下有一个用于描述该类的文档字符串.
# 如果你的类有公共属性(Attributes),
# 那么文档中应该有一个属性(Attributes)段.
# 并且应该遵守和函数参数相同的格式.
class
SampleClass
():
"""
Summary of class here.
Longer class information....
Attributes:
likes_spam: A boolean indicating if we like SPAM or not.
eggs: An integer count of the eggs we have laid.
"""
def
__init__
(
self
,
likes_spam
=
False
):
"""Inits SampleClass with blah."""
self
.
likes_spam
=
likes_spam
self
.
eggs
=
"eggs"
def
public_method_one
(
self
,
egg
,
fun
):
"""
Description: Function description information
Args:
egg: egg information
fun: fun information
Returns:
Returned information
Raises:
AttributeError
"""
self
.
eggs
=
"eggs"
egg
=
"egg"
fun
=
"fun"
return
egg
,
fun
def
public_method_two
(
self
,
tom
):
"""
Description: Function description information
Args:
tom: tom information
Returns:
Returned information
Raises:
Error
"""
self
.
likes_spam
=
True
tom
=
'cat'
return
tom
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录