Python到底是强类型语言,还是弱类型语言?



前言

动静类型与强弱类型

强类型:Java、C#、Python、Ruby、Erlang(再加GO、Rust)…… 弱类型:C、C++、Javascript、Perl、PHP、VB……

过去的强弱类型概念

In 1974, Liskov and Zilles defined a strongly-typed language as one in which "whenever an object is passed from a calling function to a called function, its type must be compatible with the type declared in the called function."[3] In 1977, Jackson wrote, "In a strongly typed language each data area will have a distinct type and each process will state its communication requirements in terms of these types."[4]

现在的强弱类型概念

Strongly checked language: A language where no forbidden errors can occur at run time (depending on the definition of forbidden error). Weakly checked language: A language that is statically checked but provides no clear guarantee of absence of execution errors.

A weakly typed language has looser typing rules and may produce unpredictable results or may perform implicit type conversion at runtime.


Python 是不是强类型语言?

其它相关的问题

小结
相关链接:


更多精彩推荐
☞TypeScript 的存在削弱了 JavaScript 生态系统?
点分享 点点赞 点在看
关注公众号:拾黑(shiheibook)了解更多
[广告]赞助链接:
四季很好,只要有你,文娱排行榜:https://www.yaopaiming.com/
让资讯触达的更精准有趣:https://www.0xu.cn/
关注网络尖刀微信公众号随时掌握互联网精彩
赞助链接
排名
热点
搜索指数
- 1 从“水之道”感悟“国之交” 7904128
- 2 日方挑衅中国收割民意非常危险 7807977
- 3 课本上明太祖画像换了 7714474
- 4 全国冰雪季玩法大盘点 7618626
- 5 日本记者街头采访找不到中国游客 7520902
- 6 20多岁女生靠偷快递为生 7428783
- 7 净网:网民造谣汽车造成8杀被查处 7332063
- 8 苟仲文受贿2.36亿余元一审被判死缓 7237939
- 9 退学北大考上清华小伙被欠家教费 7137674
- 10 流感自救抓住“黄金48小时” 7040137










CSDN
