def method_plus(self, space, w_other): assert isinstance(w_other, W_StringObject) total_size = self.length() + w_other.length() s = space.newstr_fromchars(newlist_hint(total_size)) s.extend(space, self) s.extend(space, w_other) return s
def BUILD_STRING(self, space, bytecode, frame, pc, n_items): items_w = frame.popitemsreverse(n_items) total_length = 0 for w_item in items_w: assert isinstance(w_item, W_StringObject) total_length += w_item.length() storage = newlist_hint(total_length) for w_item in items_w: assert isinstance(w_item, W_StringObject) w_item.strategy.extend_into(w_item.str_storage, storage) frame.push(space.newstr_fromchars(storage))
def f(i): while i > 0: driver.jit_merge_point(i=i) l = newlist_hint(5) l.append(1) i -= l[0]
def f(i): l = newlist_hint(i) l[0] = 55 return len(l)
def f(i): z = strings[i] x = newlist_hint(sizehint=13) x += z return ''.join(x)