Posted in Python onFebruary 10, 2013
def ReadOnlyObject(**args): dictBI = {} args_n = [] for name, val in args.items(): dictBI[name] = val args_n.append(name) dictBI['__slots__'] = args_n return type('ReadOnlyObject', (object,), dictBI)()
python创建只读属性对象的方法(ReadOnlyObject)
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@