mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 09:53:32 +01:00
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>
11 lines
222 B
Python
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]
|