Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardPythonmetaclasses and __new__Single-choice MCQ

In a metaclass, what is the execution order of the three hooks involved in building a class statement, and which one decides the namespace mapping the class body executes in?

class Meta(type): @classmethod def __prepare__(mcs, name, bases, **kw): ... def __new__(mcs, name, bases, ns, **kw): ... def __init__(cls, name, bases, ns, **kw): ...