def rtype_hint(self, hop): hints = hop.args_s[-1].const optimized = getattr(self.listitem, 'hint_maxlength', False) if optimized and 'maxlength' in hints: return self.rtype_hint_maxlength(hop) elif 'fence' in hints: return self.rtype_hint_fence(hop) return AbstractBaseListRepr.rtype_hint(self, hop)
def rtype_hint(self, hop): hints = hop.args_s[-1].const if 'maxlength' in hints: v_list = hop.inputarg(self, arg=0) # XXX give a hint to pre-allocate the list (see lltypesystem/rlist) return v_list if 'fence' in hints: return hop.inputarg(self, arg=0) return AbstractBaseListRepr.rtype_hint(self, hop)
def rtype_hint(self, hop): hints = hop.args_s[-1].const if 'maxlength' in hints or 'fence' in hints: # see doc/discussion/list_comprehension_ootype.txt assert False, 'TODO' return AbstractBaseListRepr.rtype_hint(self, hop)