Skip to content

Instantly share code, notes, and snippets.

@shazow
Created December 6, 2009 08:59
Show Gist options
  • Save shazow/250137 to your computer and use it in GitHub Desktop.
Save shazow/250137 to your computer and use it in GitHub Desktop.
Clever dumb object for faux proxy purposes.
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