I\'m debugging some Python that takes, as input, a list of objects, each with some attributes.
I\'d like to hard-code some test values -- let\'s say, a list of four
Have a look at this:
class MiniMock(object): def __new__(cls, **attrs): result = object.__new__(cls) result.__dict__ = attrs return result def print_foo(x): print x.foo print_foo(MiniMock(foo=3))