@_FFI.callback(u'Value(ExternContext*, Value*, Field*, TypeId*)')
def extern_project(context_handle, val, field, type_id):
 c = _FFI.from_handle(context_handle)
 obj = c.from_value(val)
 field_name = c.from_key(field)
 typ = c.from_id(type_id.id_)
 projected = getattr(obj, field_name)
 if (type(projected) is not typ):
  projected = typ(projected)
 return c.to_value(projected)

@ _FFI . callback ( u'Value(ExternContext*, Value*, Field*, TypeId*)' ) def extern_project ( context_handle , val , field , type_id ) : c = _FFI . from_handle ( context_handle ) obj = c . from_value ( val ) field_name = c . from_key ( field ) typ = c . from_id ( type_id . id_ ) projected = getattr ( obj , field_name ) if ( type ( projected ) is not typ ) : projected = typ ( projected ) return c . to_value ( projected )
given a value for obj .