

@classdef.method('join')
def method_join(self, space, w_sep=None):
    if (not self.items_w):
        return space.newstr_fromstr('')
    if (w_sep is None):
        separator = ''
    elif space.respond_to(w_sep, 'to_str'):
        separator = space.str_w(space.send(w_sep, 'to_str'))
    else:
        raise space.error(space.w_TypeError, ("can't convert %s into String" % space.getclass(w_sep).name))
    return space.newstr_fromstr(separator.join([space.str_w(space.send(w_o, 'to_s')) for w_o in self.items_w]))

dataset/ETHPy150Open topazproject/topaz/topaz/objects/arrayobject.py W_ArrayObject.method_join/original