예제 #1
0
def str_split__Rope_None_ANY(space, w_self, w_none, w_maxsplit=-1):
    selfnode = w_self._node
    maxsplit = space.int_w(w_maxsplit)
    res_w = [
        W_RopeObject(node) for node in rope.split_chars(selfnode, maxsplit)
    ]
    return space.newlist(res_w)
예제 #2
0
def unicode_split__RopeUnicode_None_ANY(space, w_self, w_none, w_maxsplit):
    selfnode = w_self._node
    maxsplit = space.int_w(w_maxsplit)
    res_w = [W_RopeUnicodeObject(node)
                for node in rope.split_chars(selfnode, maxsplit, _isspace)]
    return space.newlist(res_w)