[Python-Dev] New type objects and PyObject_New
Guido van Rossum
guido@python.org
Tue, 09 Apr 2002 18:54:54 -0400
[Thomas Heller]
> > It seems possible to create new type objects still with
> > PyObject_New() instead of calling the type object.
> > Is this a bug?
[David Abrahams]
> I sure hope not! I need that functionality!
Um, PyObject_New() is the low-level allocation function that you
should be calling from the type's tp_new, not something you should be
calling elsewhere to create an instance of a type.
--Guido van Rossum (home page: http://www.python.org/~guido/)