Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is a metaclass?
Think of it as a class of a class.
What is the default metaclass in Python?
It's a common built-in name.
What is the purpose of a metaclass?
Think about what lays the foundation for class behavior.
True or False: Every class in Python is an instance of a metaclass.
Consider the definition of instances.
Implement a custom metaclass that ensures any new class has a specific method called initialize. Test it with any class you define.
What method has to be checked in the dictionary of the class before raising an error?
Using the type() function, create a simple class that contains a method to display a greeting. Then add a new_method dynamically using setattr().
What do you need to create a class dynamically and then modify it?
5 more questions in this section. Enroll free to practise them all.
Enroll free