(no title)
marcianx | 1 year ago
And your answer for Python is not quite correct: "" is falsy in Python, and both of the last two when translated to Python give "null".
marcianx | 1 year ago
And your answer for Python is not quite correct: "" is falsy in Python, and both of the last two when translated to Python give "null".
LegionMammal978|1 year ago
randomdata|1 year ago
What gives you that impression? "abc".slice(4, 10) is perfectly valid and accepted, assuming the code above is accurate.
paulddraper|1 year ago
I ask for a range whose start is in bounds but whose end is out of bounds.
Why should those return two entirely different types?
t-writescode|1 year ago
And yes, I also understand the logic of the API; but if you're used to using slice to protect against random NPEs and out-of-bounds exceptions - which is something I do and am used to being able to trust in as a general pattern.