def build_list(context, builder, list_type, items):
 nitems = len(items)
 inst = ListInstance.allocate(context, builder, list_type, nitems)
 inst.size = context.get_constant(types.intp, nitems)
 for (i, val) in enumerate(items):
  inst.setitem(context.get_constant(types.intp, i), val)
 return impl_ret_new_ref(context, builder, list_type, inst.value)

def build_list ( context , builder , list_type , items ) : nitems = len ( items ) inst = ListInstance . allocate ( context , builder , list_type , nitems ) inst . size = context . get_constant ( types . intp , nitems ) for ( i , val ) in enumerate ( items ) : inst . setitem ( context . get_constant ( types . intp , i ) , val ) return impl_ret_new_ref ( context , builder , list_type , inst . value )
build a list of the given type .