【Python】Instantiation, Module

2023-05-09  本文已影响0人  盐果儿

What is instantiation?

Instantiation is the process of creating an instance or an object of a class. 

A class is a template that defines the properties and behaviors of an object.

An instance is a special realization of that template with its own unique data and state.

What is a module object in Python?

In Python, a module is a file containing Python definitions and statements. When you import a module, Python executes the code in the module file and creates a module object that represents the module. The module object is an instance of the ModuleType class and it contains the module's attributes and functions.

上一篇 下一篇

猜你喜欢

热点阅读