Python object type

Source: Internet
Author: User

Python object type
1. python is an object-oriented programming language. objects are instantiated from classes. In Python, all the data stored in the program is variable 2. each object has an identity, a type, and a value identity. It can be understood that the location type of the object stored in the memory is also called a category, describes the internal representation of an object and the supported methods. when creating an object, you can also understand that this object is an instance of this type. When an instance is created, its identity and type cannot be changed, the variable change is only because it can reference different memory objects. in Python, there is also a garbage collector similar to that in java, which automatically recycles non-referenced memory objects. 4. in python, the composite data type contains lists and meta-groups, which are memory objects. The list stores object references. These objects can be strings and these character sequences are also memory objects. These objects that contain object references are called containers in python 5. most objects have their specific data attributes and method attributes: value methods related to objects: functions that perform certain operations on objects when called, you can simply think that a class contains data and methods. An object is instantiated from a class, and the method of this class represents the operations that can be performed on the objects of the instance. attributes and methods of accessing objects 6. comparison of object comparison values "=": compare whether the values of the two objects are of the same type comparison is, type (a) is type (B ): compare whether the types of object a and object B are consistent identity comparison: whether the objects referenced by the two variables are the same

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.