输出结果:
"""-------------------- nf.__dict__ 与 f.__dict__ 对比 --------------------{'role': 'father', 'name': 'lilei', 'salary': 1000}{'role': 'son', 'name': 'liwei', 'salary': 2000, 'kind': 'salesman'}{'kind'}-------------------- NewFamily.__dict__ 与 Family.__dict__ 对比 --------------------{'__module__': '__main__', '__doc__': '\n 定义一个公共账号 ,只要有人上班 , 就将钱存到这个账号上\n ', 'share_money': 0, 'native_place': ['china'], '__init__': <function Family.__init__ at 0x000001EC8159D288>, 'work': <function Family.work at 0x000001EC8159D318>, 'fun': <function Family.fun at 0x000001EC8159D3A8>, '__dict__': <attribute '__dict__' of 'Family' objects>, '__weakref__': <attribute '__weakref__' of 'Family' objects>}{'__module__': '__main__', 'new_account': 0, '__init__': <function NewFamily.__init__ at 0x000001EC8159D438>, 'work': <function NewFamily.work at 0x000001EC8159D4C8>, '_NewFamily__expenditure': <function NewFamily.__expenditure at 0x000001EC8159D558>, '__doc__': None}{'_NewFamily__expenditure', 'new_account'}-------------------- dir(nf) 与 dir(f) 对比 --------------------['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'fun', 'name', 'native_place', 'role', 'salary', 'share_money', 'work']['_NewFamily__expenditure', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'fun', 'kind', 'name', 'native_place', 'new_account', 'role', 'salary', 'share_money', 'work']{'_NewFamily__expenditure', 'new_account', 'kind'}-------------------- dir(NewFamily) 与 dir(Family) 对比 --------------------['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'fun', 'native_place', 'share_money', 'work']['_NewFamily__expenditure', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'fun', 'native_place', 'new_account', 'share_money', 'work']{'_NewFamily__expenditure', 'new_account'}"""
推荐阅读
- 军棋这个游戏怎么玩(军棋属于什么游戏)
- 一加手机到底怎么样(国产一加属于什么档次)
- OpenDataV低代码平台增加自定义属性编辑
- 我公司是属于生产制造业,最近考虑实施ERP,生产制造业的ERP那家比较好?
- 瑞道锆业资讯 瑞道金属网今日锆产业
- 根据不同时辰看生肖属鼠的财运,属鼠的你必看
- 属羊人未来5年的运势 要时刻注意事业运势情况
- 92年属猴人注定的婚姻解析,要注意什么
- 95年属猪运气在2023年是怎么样的 人生三大方面剖析
- 98年属虎女事业发展如何 赶紧来看看她们的情况