Beispiel #1
0
 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
Beispiel #2
0
 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
Beispiel #3
0
    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))
Beispiel #4
0
 def f(i):
     while i > 0:
         driver.jit_merge_point(i=i)
         l = newlist_hint(5)
         l.append(1)
         i -= l[0]
Beispiel #5
0
 def f(i):
     l = newlist_hint(i)
     l[0] = 55
     return len(l)
Beispiel #6
0
 def f(i):
     z = strings[i]
     x = newlist_hint(sizehint=13)
     x += z
     return ''.join(x)
Beispiel #7
0
 def f(i):
     while i > 0:
         driver.jit_merge_point(i=i)
         l = newlist_hint(5)
         l.append(1)
         i -= l[0]
Beispiel #8
0
 def f(i):
     l = newlist_hint(i)
     l[0] = 55
     return len(l)
Beispiel #9
0
 def f(i):
     z = strings[i]
     x = newlist_hint(sizehint=13)
     x += z
     return ''.join(x)