This is my attempt at understanding what it does:
>>> ~
SyntaxError: invalid syntax
>>> print ~
SyntaxError: invalid syntax
>>> ~ = cheese
SyntaxError: invalid syntax
>>> ~ = "21"
SyntaxError: invalid syntax
>>> 2 ~ 1
SyntaxError: invalid syntax
>>> ~ = "w"
SyntaxError: invalid syntax
>>> a = "w"
>>> a
'w'
>>> print ~8
-9
>>> print ~w
Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
print ~w
NameError: name 'w' is not defined
>>> print ~"w"
It seems to only work with numbers, so an explanation and a link to some documentation would be very helpful.