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 the default metaclass used in Python?
Think about the built-in capabilities of Python.
True or False: A metaclass can add attributes to classes on creation.
Consider the capabilities of what a metaclass can do.
What method is overridden to modify class creation in a metaclass?
Consider what method is responsible for instantiating objects.
True or False: Metaclasses can be used to modify class attributes after a class is created.
Think about the lifecycle of a class and when metaclasses come into play.
Create a custom metaclass that prevents a class from being created if it does not have any attributes defined.
Loop through the dictionary to check for keys.
Build a metaclass that adds a logging mechanism every time a method is called within the class.
Think about how you would monitor messages before calling a method.
4 more questions in this section. Enroll free to practise them all.
Enroll free