def __getattr__(self, attr):
        "Provide attribute access to retrieve dictionary items."
        
        # in case of error AttributeError is to be
        # raised instead of KeyError
        try:
            return self[attr]
        except KeyError:
            raise AttributeError, ("'%s' instance has no attribute '%s'" %
                                   (self.__class__.__name__, attr))
Provide attribute access to retrieve dictionary items.
recipes/Python/303347_Get_configured/recipe-303347.py