Regression python Training-classes and objects, inheritance, polymorphism and polymorphism, encapsulation, binding methods and unbound methods, reflection

Source: Internet
Author: User
Tags reflection

First, review:

1, the process: The core is the process, the process is the steps to solve the problem, that is, what to do first, what to do, based on process-oriented design procedures, like in the design of a pipeline, is a mechanical thinking method.

Pros: Complex questions to simplify

Cons: Poor scalability (holding a body)
Application scenario: Linux kernel, httpd,git

2, Object-oriented programming: The core is the object, to understand the object should regard themselves as God, in the eyes of God all things exist are objects, not exist can also be created, objects are features (variables) and skills (functions) of the Union

Advantages: Strong Scalability

Cons: You can't know exactly what stage is going to happen and what happens when it's a process-oriented

Application scenario: Interaction with the user layer, in-house software, games, Internet software

The concepts of classes and types are unified in Python3, and they are the same.

1 >>> s=str ('asdf')2 >>> s="  ASDF"3 >>> type (s)4 <class'  Str'>

A factory function defines a class that can instantiate a single object. (Str,list,dict,set. )

Producing an object yields three properties: ID (in memory position), type and value (value)

# x=int (1) # ID # type # value

Regression python Training-classes and objects, inheritance, polymorphism and polymorphism, encapsulation, binding methods and unbound methods, reflection

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.