]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Thinking back to the 2.22 revision, I didn't like what I did there one
authorGuido van Rossum <guido@python.org>
Thu, 9 Aug 2001 19:38:15 +0000 (19:38 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 9 Aug 2001 19:38:15 +0000 (19:38 +0000)
commitc11e192d416e2970e6a06cf06d4cf788f322c6ea
tree2f7ddcb418dcc70bd1ac92f618ac2275d7823a1f
parenta995c91243fe1980551b81b116ec93bb9a38a974
Thinking back to the 2.22 revision, I didn't like what I did there one
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!
Objects/typeobject.c