Skip to content

Instantly share code, notes, and snippets.

@mw44118
Created August 17, 2015 01:57
Show Gist options
  • Save mw44118/391eb2f8ec19d4a001ce to your computer and use it in GitHub Desktop.
Save mw44118/391eb2f8ec19d4a001ce to your computer and use it in GitHub Desktop.
class Centipede(object):
def __init__(self):
self.legs = list()
self.stomach = list()
def __call__(self, val):
self.stomach.append(val)
def __str__(self):
return ",".join(self.stomach)
def __setattr__(self, slot, val):
self.__dict__[slot] = val
self.legs.append(slot)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment