Are metaclasses objects?

70 Views Asked by At

I always hear or read that 'everything in Python is an object'. This sentence is really helpful for beginner programmers as myself, and I was quickly able to understand that classes, methods are objects.

However, when trying to understand the mechanism of class creation a bit deeper, I've stumbled upon the concept of metaclasses and this brilliant question was able to unveil almost everything that I didn't know about classes: What are metaclasses in Python?

Now I know that instances of metaclasses are classes, and instances of classes are instances(?)/objects(?). The repetitive use of the word object boggles me, so I will call the instances of a class also instances, since classes are objects too. This reasoning concludes us to my question: Are metaclasses also objects? What is the exact definition of an object?

I assume that metaclasses are objects. Since they have attributes, they have their parent classes, so they are themselves instances of classes.

0

There are 0 best solutions below