3 ms·
You can simplify it a bit by building the container class on the fly, if desired. >>> x = type('Foo', (object,), {}) >>> x.bar = 1 >>> x.bar 1
by stock_toaster 15y ago
You can simplify it a bit by building the container class on the fly, if desired.
>>> x = type('Foo', (object,), {})
>>> x.bar = 1
>>> x.bar
1