Ejemplo n.º 1
0
 def rtype_getattr(self, hop):
     s_attr = hop.args_s[1]
     if s_attr.is_constant() and isinstance(s_attr.const, str):
         attr = s_attr.const
         s_obj = hop.args_s[0]
         v_array, vattr = hop.inputargs(self, Void)
         getter = getattr(self, 'get_' + attr, None)
         if getter:
             return getter(hop, v_array)
     return Repr.rtype_getattr(self, hop)
Ejemplo n.º 2
0
 def rtype_getattr(self, hop):
     s_attr = hop.args_s[1]
     if s_attr.is_constant() and isinstance(s_attr.const, str):
         attr = s_attr.const
         s_obj = hop.args_s[0]
         v_array, vattr = hop.inputargs(self, Void)
         getter = getattr(self, 'get_'+attr, None)
         if getter:
             return getter(hop, v_array)
     return Repr.rtype_getattr(self, hop)
Ejemplo n.º 3
0
 def convert_const(self, value):
     if value is None:
         return ootype.null(self.lowleveltype)
     else:
         return Repr.convert_const(self, value)
Ejemplo n.º 4
0
 def convert_const(self, value):
     if value is None:
         return ootype.null(self.lowleveltype)
     else:
         return Repr.convert_const(self, value)