def _fill_defaults(context, builder, sig, args, defaults):
 ty = sig.return_type
 llty = context.get_data_type(ty)
 args = (tuple(args) + tuple((ir.Constant(llty, d) for d in defaults[len(args):])))
 sig = signature(*((ty,) * (len(args) + 1)))
 return (sig, args)

def _fill_defaults ( context , builder , sig , args , defaults ) : ty = sig . return_type llty = context . get_data_type ( ty ) args = ( tuple ( args ) + tuple ( ( ir . Constant ( llty , d ) for d in defaults [ len ( args ) : ] ) ) ) sig = signature ( * ( ( ty , ) * ( len ( args ) + 1 ) ) ) return ( sig , args )
assuming a homogenous signature .