Alternative implementation of session state

A more generic solution for Classes which the only downside is that all parameters must be initialized with default values.

def MyClass:
    __init__(self, a=None, b=None):
        self.a = a
        self.b = b


def get_class(class_, **kargs):
    return class_(**kargs)

Example:
my_class = get_state(get_class, class_=MyClass, a=a, b=b)

@biellls thanks for so useful functions :smiley:

1 Like