3 ms·
The other commenter pointed out the "inplace" version, but in the event I can't get away with that (or don't want to for some reason), I tend to throw in some n
by Sileni 8y ago
The other commenter pointed out the "inplace" version, but in the event I can't get away with that (or don't want to for some reason), I tend to throw in some numbering scheme on my original variable, and at the end replace the original variable or move to a "result_object" sort of name.
I think this is an edge case that is always going to feel inelegant, so whatever makes it easiest to load into my head wins out.