ooscrewyou
2013-02-28 15:02:24 +08:00
看了下Wikipeadia把Python歸爲強類型語言
The object-oriented programming languages Smalltalk, Ruby, Python, and Self are all "strongly typed" in the sense that typing errors are prevented at runtime and they do little implicit type conversion, but these languages make no use of static type checking: the compiler does not check or enforce type constraint rules.
不過strong typed是打引號的。
Python裏面
>>> 1 == 1.0
True
>>> 1 + 1.1
2.1
ML系的帶類型推倒的靜態語言是嚴格區分整數和浮點數的
# 1 + 1.;;
Error: This expression has type float but an expression was expected of type
int
不過樓主說Python是腳本語言是不對的,只要你願意,完全可以寫一個Python編譯器出來。沒有腳本語言的說法,只是說某個語言的實現是腳本運行的。