【发布时间】:2014-06-12 00:37:13
【问题描述】:
我认为文档字符串更多的是个人喜好,但我想得到一些比我聪明的人的意见......
这是记录 get/set 性质 pythons @property 描述符属性的合法方式吗?
class Handle(rgm.RigModule):
'''
Handle nodes are intended to be keyable transforms, made viewable by shape nodes connected as children
@Properties:
parent:
Transform: Returns Transform instance if parent exists, otherwise None
parent.setter:
(str): Sets parent transform. (Accepts string name of transform, or any instance of the Transform class)
shape:
str: returns string representation of current shape
shape.setter:
(str): sets current shape using string representation provided. If string key does not exist in library, shape will be set to None
shapeDraw:
dict: returns dictionary of shape data
shapeDraw.setter:
(dict): sets current shapes using data
shapeColor:
int: returns integer representation of current shape color
shapeColor.setter:
(int): sets current shape color using integer provided.
shapeColor:
int: returns integer representation of current shape color
shapeColor.setter:
(int): sets current shape color using integer provided.
shapeTranslate:
list: returns a 3list of the shape nodes relative offset translation
shapeTranslate.setter:
(list): sets relative offset translation of the shape nodes
shapeRotate:
list: returns a 3list of the shape nodes relative offset rotation
shapeRotate.setter:
(list): sets relative offset rotation of the shape nodes
shapeScale:
list: returns a 3list of the shape nodes relative offset scale
shapeScale.setter:
(list): sets relative offset scale of the shape nodes
shapeMatrix:
list: returns a 8list of the shape nodes relative offset matrix
shapeMatrix.setter:
(list): sets relative offset matrix of the shape nodes
【问题讨论】:
-
看起来 Doxygen 分别列出了属性和 property.setter。这肯定会比我现在做的更好。
标签: python properties python-sphinx doxygen maya