Possible Duplicate:
accessing a python int literals methods
Integer literal is an object in Python?
In python it's possible, and sometimes even common, to call methods or look up attributes directly on literals:
>>> "-".join("abc")
'a-b-c'
>>> {1: 3, 2: 9}.pop(1)
3
>>> 3j.imag
3.0
>>> 8.0.__add__(8)
16.0
But for some reason this does not work on integer objects:
>>> 3.__add__(42)
File "<stdin>", line 1
3.__add__(42)
^
SyntaxError: invalid syntax
Why not?