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

A class defines both __new__ returning an object whose type is NOT the class, and __init__. What governs whether __init__ runs?

class Weird: def __new__(cls): return 42 def __init__(self): print("init ran") w = Weird() print(type(w))