AutoFillKw Class
- class kwhelp.decorator.AutoFillKw(cls)[source]
Class decorator that replaces the
__init__function with one that sets instance attributes with the specified key, value ofkwargs. The original__init__is called with any*argsafter the instance attributes have been assigned.Example
>>> @AutoFillKw ... class Foo: pass >>> sorted(Foo(a=1, b=2, End="!").__dict__.items()) [('End', '!'), ('a', 1), ('b', 2)]