def __getattr__(self, attr):
        """Return the desired friend method.
        
        Note, these methods will be cached in ``self._friendCache``.

        """
        if not self.__dict__.has_key("_friendCache"):
            self._friendCache = {}
        cache = self._friendCache 
        if not cache.has_key(attr):
            pieces = self.__module__.split(".")
            pieces[-1] = pieces[-1].lower()
            pieces.append(attr)
            moduleName = ".".join(pieces)
            try:
                module = __import__(moduleName, {}, {}, [attr])
            except:
                raise (AttributeError, """\
%s instance has no attribute '%s', and HasFriends failed too""" % 
                       (self.__class__.__name__, attr))
            f = getattr(module, attr)
            curry = Curry(f, self)
            cache[attr] = curry
        return cache[attr]
Return the desired friend method.
        
        Note, these methods will be cached in ``self._friendCache``.

        
recipes/Python/363780_HasFriends/recipe-363780.py