You 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.
Re:Python: Bitwise NOT and List
by foonamefoo on Friday March 28, 2008 @12:05AM
(#148316)
your humor detection may be broken.
I 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).
x[::~0][~-1]
trick to get the last item. Thought that's what everyone uses.