E.g. when I want to carry a foo, a bar, and a baz around, but namedtuple isn't right (e.g. I need mutation). I'd prefer
config = Someclass() config.foo = 1 config.bar = "quux" config.baz = 3.3
over:
config = { 'foo': 1, 'bar': "quux", 'baz': 3.3 }
E.g. when I want to carry a foo, a bar, and a baz around, but namedtuple isn't right (e.g. I need mutation). I'd prefer
and then using config.bar, etc.over:
and then using config['bar']