def bound_function(template_key):
 def wrapper(method_resolver):
  @functools.wraps(method_resolver)
  def attribute_resolver(self, ty):
   class MethodTemplate(AbstractTemplate, ):
    key = template_key
    def generic(_, args, kws):
     sig = method_resolver(self, ty, args, kws)
     if ((sig is not None) and (sig.recvr is None)):
      sig.recvr = ty
     return sig
   return types.BoundFunction(MethodTemplate, ty)
  return attribute_resolver
 return wrapper

def bound_function ( template_key ) : def wrapper ( method_resolver ) : @ functools . wraps ( method_resolver ) def attribute_resolver ( self , ty ) : class MethodTemplate ( AbstractTemplate , ) : key = template_key def generic ( _ , args , kws ) : sig = method_resolver ( self , ty , args , kws ) if ( ( sig is not None ) and ( sig . recvr is None ) ) : sig . recvr = ty return sig return types . BoundFunction ( MethodTemplate , ty ) return attribute_resolver return wrapper
wrap an attributetemplate resolve_* method to allow it to resolve an instance methods signature rather than a instance attribute .