jw-python/tools/python/jwutils/Bunch.py
Jan Lindemann b2b726b632 Bunch: Add class
jwutils.Bunch is a simple wrapper around a dictionary, which allows
member-type access to to dictionary data.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-07-27 14:11:42 +02:00

11 lines
222 B
Python

# -*- coding: utf-8 -*-
from typing import Any
class Bunch: # export
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def __getitem__(self, key: str) -> Any:
return self.__dict__[key]