parameters: (typ, obj, c)
return_statement: return NativeValue(c.builder.load(listptr),
                         is_error=c.builder.load(errorptr),
                         cleanup=cleanup)
docstring: Convert list *obj* to a native list.
  
      If list was previously unboxed, we reuse the existing native list
      to ensure consistency.
docstring_summary: Convert list *obj* to a native list.
docstring_tokens: Convert list * obj * to a native list .
function: def unbox_list(typ, obj, c):
      """
      Convert list *obj* to a native list.
  
      If list was previously unboxed, we reuse the existing native list
      to ensure consistency.
      """
      size = c.pyapi.list_size(obj)
  
      errorptr = cgutils.alloca_once_value(c.builder, cgutils.false_bit)
      listptr = cgutils.alloca_once(c.builder, c.context.get_value_type(typ))
  
      # See if the list was previously unboxed, if so, re-use the meminfo.
      ptr = c.pyapi.object_get_private_data(obj)
  
      with c.builder.if_else(cgutils.is_not_null(c.builder, ptr)) \
          as (has_meminfo, otherwise):
  
          with has_meminfo:
              # List was previously unboxed => reuse meminfo
              list = listobj.ListInstance.from_meminfo(c.context, c.builder, typ, ptr)
              list.size = size
              if typ.reflected:
                  list.parent = obj
              c.builder.store(list.value, listptr)
  
          with otherwise:
              _python_list_to_native(typ, obj, c, size, listptr, errorptr)
  
      def cleanup():
          # Clean up the associated pointer, as the meminfo is now invalid.
          c.pyapi.object_reset_private_data(obj)
  
      return NativeValue(c.builder.load(listptr),
                         is_error=c.builder.load(errorptr),
                         cleanup=cleanup)
function_tokens: def unbox_list ( typ , obj , c ) : size = c . pyapi . list_size ( obj ) errorptr = cgutils . alloca_once_value ( c . builder , cgutils . false_bit ) listptr = cgutils . alloca_once ( c . builder , c . context . get_value_type ( typ ) ) # See if the list was previously unboxed, if so, re-use the meminfo. ptr = c . pyapi . object_get_private_data ( obj ) with c . builder . if_else ( cgutils . is_not_null ( c . builder , ptr ) ) as ( has_meminfo , otherwise ) : with has_meminfo : # List was previously unboxed => reuse meminfo list = listobj . ListInstance . from_meminfo ( c . context , c . builder , typ , ptr ) list . size = size if typ . reflected : list . parent = obj c . builder . store ( list . value , listptr ) with otherwise : _python_list_to_native ( typ , obj , c , size , listptr , errorptr ) def cleanup ( ) : # Clean up the associated pointer, as the meminfo is now invalid. c . pyapi . object_reset_private_data ( obj ) return NativeValue ( c . builder . load ( listptr ) , is_error = c . builder . load ( errorptr ) , cleanup = cleanup )