Use __getitem__ instead of __getattr__