No problem, I didn't thought of None/None, at first. I found it while looking for a simpler solution with max(0, start), min(len(src),end)