Python creates a method of ReadOnlyObject for a read only attribute object
- 2020-04-02 09:44:29
- OfStack
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)()