-
-
Save dcolish/1448244 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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