
python
wangsx1212
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
数据流处理器类
#streams.pyclass Processor: def __init__(self,reader,writer): self.reader = reader self.writer = writer def process(self): while 1: data = self.reader.readlin原创 2017-10-15 21:15:33 · 573 阅读 · 0 评论 -
使用dir列出包含继承的属性
lister1.pyclass ListInherited: def __str__(self): return '<Instance of %s,address %s:\n%s>'%( self.__class__.__name__, id(self), self.__attrnames()) d原创 2017-10-15 23:50:31 · 243 阅读 · 0 评论 -
用__dict__列出实例属性的通用工具
lister.pyclass ListInstance: ''' Mix-in class that provides a formatted print() or str() of instances via inheritance of __str__,coded here;displays instance attrs only;self is the inst原创 2017-10-15 23:17:23 · 308 阅读 · 0 评论