Created
December 6, 2009 08:59
-
-
Save shazow/250137 to your computer and use it in GitHub Desktop.
Clever dumb object for faux proxy purposes.
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 DumbObject(object): | |
def __init__(self, len=1): | |
self.len = len | |
def __call__(self, *args, **kw): | |
return self | |
def __getattr__(self, name): | |
return self | |
def __getitem__(self, i): | |
return self | |
def __len__(self): | |
return self.len |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment