Skip to content

Instantly share code, notes, and snippets.

@dcolish
Forked from ericholscher/gist:1448223
Created December 8, 2011 19:47
Show Gist options
  • Save dcolish/1448244 to your computer and use it in GitHub Desktop.
Save dcolish/1448244 to your computer and use it in GitHub Desktop.
class Mock(object):
def __init__(self, *args, **kwargs):
pass
def __getattr__(self, name):
return Mock()
m = Mock()
print m.awesome
# output <__main__.Mock object at 0x100456750>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment