摘要: class Foo(object): def __init__(self, name, age): self.name = name self.age = age def __getitem__(self, item): if hasattr(self, item): return self.__dict__[item] def __setitem__(self, k... 阅读全文
posted @ 2018-09-05 23:35 ADChen 阅读(134) 评论(0) 推荐(0) 编辑