• Guido van Rossum's avatar
    Thinking back to the 2.22 revision, I didn't like what I did there one · c11e192d
    Guido van Rossum authored
    bit.  For one, this class:
    
        class C(object):
            def __new__(myclass, ...): ...
    
    would have no way to call the __new__ method of its base class, and
    the workaround (to create an intermediate base class whose __new__ you
    can call) is ugly.
    
    So, I've come up with a better solution that restores object.__new__,
    but still solves the original problem, which is that built-in and
    extension types shouldn't inherit object.__new__.  The solution is
    simple: only "heap types" inherit tp_new.  Simpler, less code,
    perfect!
    c11e192d
typeobject.c 63.7 KB