Sometimes I need to create an anonymous class instance in python, just like c#:
var o = new {attr1="something", attr2=344};
but in python I do it in this way:
class Dummy: pass
o = Dummy()
o.attr1 = 'something'
o.attr2 = 344
# EDIT 1
print o.attr1, o.attr2
how can I do that in a Pythonic way and a single statement?
o = type('Dummy', (object,), { "attr1": "somehing", "attr2": 344 })
o.attr3 = "test"
print o.attr1, o.attr2, o.attr3