Implements the Python mapping protocol (__getitem__).