Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@john2x
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save john2x/e6a70aafcd208e1f9a88 to your computer and use it in GitHub Desktop.
Save john2x/e6a70aafcd208e1f9a88 to your computer and use it in GitHub Desktop.
class Container(object):
def __init__(self, items):
self.items = items # items is a list or tuple
def __len__(self):
return len(self.items)
def __getitem__(self, i):
return self.items[i]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment