SyntaxFix
Write A Post
Hire A Developer
Questions
You are looking for the __getitem__ method. See http://docs.python.org/reference/datamodel.html, section 3.4.6
__getitem__