2013年4月28日
摘要: 地址:http://docs.python.org/3/library/copy.htmlAssignment statements in Python do not copy objects, they create bindings between a target and an object. For collections that are mutable or contain mutable items, a copy is sometimes needed so one can change one copy without changing the other. This mod 阅读全文
posted @ 2013-04-28 21:34 101010 阅读(326) 评论(0) 推荐(0) 编辑
摘要: # filename: class_static.pyclass Parent: name = "I'm the parent" @staticmethod def print_name_by_static(): print(Parent.name) @classmethod def print_name_by_class(cls): print(cls.name)class Child(Parent): pass #(1) # name = "I'm the child" #(2)if __name__ == "__mai.. 阅读全文
posted @ 2013-04-28 01:21 101010 阅读(229) 评论(0) 推荐(0) 编辑