python None in slice notation
After for the nth time writing awkward code like
if limit is None: limit = len(mylist)
decided to see if there’s a better way. Looked into the walrus operator etc,but decided to test what I get with
mylist[:None] works! No errors, I’d guess I get a copy of it same as
Will save me hundreds of lines in the future!
slice1 is terse, says it uses
range(start,end,step) under the hood with
step defaulting to None. But
range doesn’t accept None for all arguments! TODO for later I guess.