Support __getitem__ and __setitem__