When people talk about object-oriented programming, classes are usually the first thing that comes up. A class can create “instances,” which we commonly refer to as objects. But in the Python world, where everything is an object, a class itself is also an object. If a class is an object, then what class creates the class object itself? Let’s use a simple class as an example:

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Classes and Where They Come From

  • Chien-Lung Kao

摘要

When people talk about object-oriented programming, classes are usually the first thing that comes up. A class can create “instances,” which we commonly refer to as objects. But in the Python world, where everything is an object, a class itself is also an object. If a class is an object, then what class creates the class object itself? Let’s use a simple class as an example: