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

Does calling type(name, bases, namespace) directly (instead of using a class statement) trigger the __set_name__ hooks on descriptors placed in the namespace?

class Field: def __set_name__(self, owner, name): ... C = type('C', (), {'x': Field()})