News for hackers. Stuff that matters.
Re:Python: Bitwise NOT and List by attack on Thursday March 27, 2008 @03:51PM (#148013)
Oh you mean the old

x[::~0][~-1]

trick to get the last item. Thought that's what everyone uses.

Re:Python: Bitwise NOT and List by slashcom on Thursday March 27, 2008 @06:32PM (#148150)
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.
Re:Python: Bitwise NOT and List by BrandonM on Friday March 28, 2008 @06:28AM (#148455)
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).