Python中的对象和类之间有什么区别
问题描述:
我是一个自我窒息的python用户(一种。)。我读了很多,以加深我对python的知识。今天我遇到一个文字说:[...]类和对象[...]。所以我想知道在python中的对象和类之间有什么区别。我所有的类都是对象,但在这种情况下,作者不会使用短语类和对象。我很困惑...
I am a self-thaught python user (kind of.). I read much to deepen my knowledge about python. Today I encountered a text saying: "[...] classes and objects [...]". So I was wondering what is the difference between objects and classes in python. I tought all classes are objects, but in that case, author wouldn't have used phrase "classes and objects". I'm confused...
答
这些是面向对象编程中两个密切相关的术语。标准含义是对象是类的实例。
These are two closely related terms in object oriented programming. The standard meaning is that an object is an instance of a class.