5 ms·
Oh you mean the old x[::~0][~-1] trick to get the last item. Thought that's what everyone uses.
by attack 19y ago
Oh you mean the old
x[::~0][~-1]
trick to get the last item. Thought that's what everyone uses.
- slashcom 19y agoYou can just use x[-1] to do the exact same thing. ~0 = -1 though, hence the reason x[~0] has kind of a nice feel to it.
- foonamefoo 19y agoyour humor detection may be broken.
- BrandonM 19y agoI don't get it, either. I mean, I realize that the OP's method would be obscure to someone who's never seen it, but at least on some level, it's more intuitive. Your example is simply obfuscated code for no other reason (other than humor, apparently, which like I said, I missed).