'Get the getattr() implementation for the given type and attribute name.
The return value is a callable with the signature
(context, builder, typ, val, attr).'

def get_getattr(self, typ, attr):

    if isinstance(typ, types.Module):
        attrty = self.typing_context.resolve_module_constants(typ, attr)
        if ((attrty is None) or isinstance(attrty, types.Dummy)):
            return None
        else:
            pyval = getattr(typ.pymod, attr)
            llval = self.get_constant(attrty, pyval)
            def imp(context, builder, typ, val, attr):
                return impl_ret_borrowed(context, builder, attrty, llval)
            return imp
    overloads = self._getattrs[attr]
    try:
        return overloads.find((typ,))
    except NotImplementedError:
        pass
    overloads = self._getattrs[None]
    try:
        return overloads.find((typ,))
    except NotImplementedError:
        pass
    raise NotImplementedError(('No    definition    for    lowering    %s.%s' % (typ, attr)))
