def update(self, d):
"""Like the dictionary .update() method.
Update the data dictionary of this SerializableObject with the .data
of d if d is a SerializableObject or if d is a dictionary, d itself.
"""
# use the parent update function
super(Composition, self).update(d)
# ...except for the 'children' field, which needs to run through the
# insert method so that _parent pointers are correctly set on children.
self._children = []
self.extend(d.get('children', []))
# @}
# @{ collections.MutableSequence implementation
composition.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录