def __getitem__(self, attr):
        """Attribute accessor method in dict-like fashion."""
        try:
            return self._data[attr]
        except:
            raise AttributeError("'%s' has no attribute '%s'" %
                                 (type(self), attr,))
def __getitem__ ( self , attr ) : try : return self . _data [ attr ] except : raise AttributeError ( "'%s' has no attribute '%s'" % ( type ( self ) , attr , ) )
Attribute accessor method in dict-like fashion.