Everything in Python is an object

———— Object Oriented————

Everything in Python is an object#

Compared with Java, Python's object-oriented approach is more thorough. Turn everything we can see into objects

Functions and classes are also objects and belong to first-class citizens of Python##

  1. Can assign functions and classes to a variable
  2. Can be added to the collection object
  3. Can be passed as a parameter to the function
  4. Can be used as the return value of a function (the implementation principle of the decorator)

The relationship between type, object and class#

type is a class, but also an object

object is the top-level base class

The relationship between type and object##

Everything inherits object

Common built-in types in Python#

Three characteristics of the object: identity (ie address, use id to get address), type (use type to get type), value

Recommended Posts

Everything in Python is an object
Is there an algorithm in python language
What is an anonymous function in Python
Is python an interpreted language
What is introspection in python
What is object-oriented in python
What is list comprehension in python
Is there function overloading in python
What is a sequence table in Python
Is a number in python a variable type
Python is mainly used in which directions
Is there a helper function in python
Python 3.9 is here!
Functions in python
10. Object Oriented Python
An article to understand the yield in Python
Learn Python in One Minute | Object Oriented (Part 1)
Why python is popular
Python is short-crawling music
03. Operators in Python entry
Join function in Python
print statement in python
Concurrent requests in Python
Install python in Ubuntu
Context management in Python
How to save IE as an attachment in python
Arithmetic operators in python
Write gui in python
MongoDB usage in Python
Str string in Python
Computational Geometry in Python
Concurrent requests in Python (part 2)
Subscripts of tuples in Python
Talking about inheritance in Python
Noteworthy update points in Python 3.9
Python is short-world epidemic map
Python iterable object de-duplication example
Containerize Python applications in 3 minutes
Python is short _SVM test
Is python code case sensitive
What is Python variable scope
Generators and iterators in Python
Talking about strings in Python