摘要: #coding=utf8class A(object): def __init__(self, name): self.name = name def __eq__(self, obj): return self.name == obj.nameif __name__ == '__main__': a = A("Leon") b = A("Leon") print a == b__eq__ 定义了类的等号(==)行为 阅读全文
posted @ 2013-05-08 16:56 践道者 阅读(12450) 评论(0) 推荐(0) 编辑