@ClassBuilder.class_impl_registry.lower_getattr_generic(types.ClassInstanceType)
def attr_impl(context, builder, typ, value, attr):
 if (attr in typ.struct):
  inst = context.make_helper(builder, typ, value=value)
  data_pointer = inst.data
  data = context.make_data_helper(builder, typ.get_data_type(), ref=data_pointer)
  return imputils.impl_ret_borrowed(context, builder, typ.struct[attr], getattr(data, _mangle_attr(attr)))
 elif (attr in typ.jitprops):
  getter = typ.jitprops[attr]['get']
  sig = templates.signature(None, typ)
  dispatcher = types.Dispatcher(getter)
  sig = dispatcher.get_call_type(context.typing_context, [typ], {})
  call = context.get_function(dispatcher, sig)
  out = call(builder, [value])
  return imputils.impl_ret_new_ref(context, builder, sig.return_type, out)
 raise NotImplementedError('attribute {0!r} not implemented'.format(attr))

@ ClassBuilder . class_impl_registry . lower_getattr_generic ( types . ClassInstanceType ) def attr_impl ( context , builder , typ , value , attr ) : if ( attr in typ . struct ) : inst = context . make_helper ( builder , typ , value = value ) data_pointer = inst . data data = context . make_data_helper ( builder , typ . get_data_type ( ) , ref = data_pointer ) return imputils . impl_ret_borrowed ( context , builder , typ . struct [ attr ] , getattr ( data , _mangle_attr ( attr ) ) ) elif ( attr in typ . jitprops ) : getter = typ . jitprops [ attr ] [ 'get' ] sig = templates . signature ( None , typ ) dispatcher = types . Dispatcher ( getter ) sig = dispatcher . get_call_type ( context . typing_context , [ typ ] , { } ) call = context . get_function ( dispatcher , sig ) out = call ( builder , [ value ] ) return imputils . impl_ret_new_ref ( context , builder , sig . return_type , out ) raise NotImplementedError ( 'attribute {0!r} not implemented' . format ( attr ) )
generic setattr() for @jitclass instances .