def __init__(self, data): check_list_of_chars(data) self._data = resizable_list_supporting_raw_ptr(data) self._offset = 0 # NOTE: the bytearray data is in 'self._data[self._offset:]' check_nonneg(self._offset) _tweak_for_tests(self)
def f(x): result = [] check_list_of_chars(result) result = [chr(x), 'a'] check_list_of_chars(result) result = [unichr(x)] check_list_of_chars(result) return result
def g(x): result = ['a', 'b', 'c', ''] check_list_of_chars(result) return x
def __init__(self, bs): assert bs is not None self.value = check_list_of_chars(bs) make_sure_not_resized(self.value)
def __init__(self, data): check_list_of_chars(data) self.data = data
def __init__(self, bs, immutable=True): assert bs is not None self.value = check_list_of_chars(bs) make_sure_not_resized(self.value) self.imm = immutable
def __init__(self, data): check_list_of_chars(data) self.data = resizable_list_supporting_raw_ptr(data)