Last active
August 29, 2015 14:09
-
-
Save john2x/e6a70aafcd208e1f9a88 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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