Python
与C / C ++
的类型不同,这似乎是你的问题。
尝试这个:
>>> i = 123
>>> type(i)
<type 'int'>
>>> type(i) is int
True
>>> i = 123456789L
>>> type(i)
<type 'long'>
>>> type(i) is long
True
>>> i = 123.456
>>> type(i)
<type 'float'>
>>> type(i) is float
True
不过,在Python 3.0中int和long之间的区别消失了。