Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.