Python的特殊屬性和用法

用__dict__把dict轉換爲對象的屬性html 1 class Messenger: 2 def __init__(self, **kwargs): 3 self.__dict__ = kwargs 4 5 6 m = Messenger(info="some information", b=[’a’, ’list’]) 7 m.more = 11 8 print
相關文章
相關標籤/搜索