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 热爱与坚守 7904757
- 2 中核集团重大突破:成功产出第一桶铀 7809345
- 3 第二代居民身份证迎换证高峰 7714217
- 4 这份防中暑秘籍请收好 7618582
- 5 全国唯一做宝剑的专业:就业率近100% 7521063
- 6 特斯拉车顶维权女车主被判赔17万 7429020
- 7 净网:来看1起侵犯公民个人信息案 7333913
- 8 中山大学133名考生取消录取资格 7235615
- 9 十分钟很短但这是她30年的痛苦 7136100
- 10 邓紫棋小说首日销售额破4000万 7048710