Skip to content

Instantly share code, notes, and snippets.

@fredrick
Created March 15, 2011 17:07
Embed
What would you like to do?
Dynamically define object variables/methods at instantiation (quick mock)
class Stub(object):
def __init__(self, **kwargs):
for key in kwargs:
setattr(self, key, kwargs[key])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment