[lang-ref] ( replace_with_range ) ( python )

def test_replace_with_range():
    #
    # slice assignment like `s[1:3] = "BC"` is not supported for str
    pytest.skip('Not supported')
def test_replace_with_range_alternative():
    text_org = 'abc def ghi\nabc def ghi'
    start = 4
    end   = 7
    s_new  = '!!DEF!!'

    text_new = text_org[:start] + s_new + text_org[end:]

    assert text_new == 'abc !!DEF!! ghi\nabc def ghi'