[Python-Dev] PyObject_New vs PyObject_NEW

Thomas Heller theller@python.net
12 Mar 2003 20:52:47 +0100


Tim Peters <tim.one@comcast.net> writes:

> [David Abrahams]
> > ...
> > It seems to me that in light of all this, it's probably worth noting
> > this difference between PyObject_New and PyObject_NEW in the docs.
> 
> I don't think the macro versions should ever be used outside the core.
> Inside the core, it's safe.  So I think the "doc bug" is that the docs
> mention PyObject_NEW at all.
> 

Better to explícitely warn about them with a wording similar to that
from the section 9.2 Memory Interface:

  In addition, the following macro sets are provided for calling the
  Python memory allocator directly, without involving the C API
  functions listed above. However, note that their use does not preserve
  binary compatibility accross Python versions [] and is therefore
  deprecated in extension modules.

Maybe 'and compilers' should be inserted between the [].

Thomas