DEV Community

Discussion on: Metaclasses in Python

Collapse
 
waylonwalker profile image
Waylon Walker

The way that you modified all of the attributes of the Sample was really great. It was simple enough to see what is going on and feel like I can grasp it just a bit better.

This might be a full article in itself, but can you explain the difference between MetaClasses and AbstractBaseClasses?

Collapse
 
sharmapacific profile image
Prashant Sharma

@Waylon, of course, it could be a full article in itself, but for now, in short -
abstract base classes cannot be instantiated. But we can pass as parent class whose child class should have all the abstract methods defined in the abstract class.

The metaClass is a class whose instances are classes.

For more, you can go through here- stackoverflow.com/questions/357079...