Python is a strongly typed dynamic language

Source: Internet
Author: User
Strong and weak type language differences:

If a language often implicitly converts the type of a variable, that language is a weakly typed language, and if it is seldom done, it is a strongly typed language.

Python rarely implicitly converts the type of a variable, so Python is a strongly typed language.

It is worth noting that:

BOOL type of source code:

The parent class of the bool class is int ... So actually:


In Python = = is actually called the __eq__ method, and the bool class inherits from the int class, and does not override the __eq__ method, so when using = =, the bool class object will naturally call the parent class __eq__ method, naturally will appear above this kind of situation. Finally, let's take a picture:



Python is a strongly typed dynamic language

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.