14 lines
340 B
Python
Raw Normal View History

2025-01-25 22:24:44 +01:00
class Object:
2025-01-25 22:28:33 +01:00
2025-01-25 22:24:44 +01:00
def __init__(self, *args, **kwargs):
for arg in args:
2025-01-25 22:28:33 +01:00
if isinstance(arg, dict):
2025-01-25 22:24:44 +01:00
self.__dict__.update(arg)
self.__dict__.update(kwargs)
2025-01-25 22:28:33 +01:00
2025-01-25 22:24:44 +01:00
def __getitem__(self, key):
return self.__dict__[key]
2025-01-25 22:28:33 +01:00
2025-01-25 22:24:44 +01:00
def __setitem__(self, key, value):
2025-01-25 22:28:33 +01:00
self.__dict__[key] = value