Asignación de objetos en el montículo
*************************************

PyObject *_PyObject_New(PyTypeObject *type)
    *Return value: New reference.*

PyVarObject *_PyObject_NewVar(PyTypeObject *type, Py_ssize_t size)
    *Return value: New reference.*

PyObject *PyObject_Init(PyObject *op, PyTypeObject *type)
    *Return value: Borrowed reference.** Part of the Stable ABI.*

   Initialize a newly allocated object *op* with its type and initial
   reference.  Returns the initialized object.  Other fields of the
   object are not affected.

PyVarObject *PyObject_InitVar(PyVarObject *op, PyTypeObject *type, Py_ssize_t size)
    *Return value: Borrowed reference.** Part of the Stable ABI.*

   Esto hace todo lo que "PyObject_Init()" hace, y también inicializa
   la información de longitud para un objeto de tamaño variable.

PyObject_New(TYPE, typeobj)

   Asigna un nuevo objeto de Python usando el tipo de estructura de C
   *TYPE* y el objeto de tipo Python *typeobj* ("PyTypeObject*"). Los
   campos no definidos por el encabezado del objeto Python no se
   inicializan. El llamador será el propietario de la única referencia
   al objeto (es decir, su contador de referencias será uno). El
   tamaño de la asignación de memoria se determina a partir del campo
   "tp_basicsize" del objeto de tipo.

   Note that this function is unsuitable if *typeobj* has
   "Py_TPFLAGS_HAVE_GC" set. For such objects, use "PyObject_GC_New()"
   instead.

PyObject_NewVar(TYPE, typeobj, size)

   Asigna un nuevo objeto de Python utilizando el tipo de estructura
   de C *TYPE* y el objeto de tipo Python *typeobj* ("PyTypeObject*").
   Los campos no definidos por el encabezado del objeto Python no se
   inicializan. La memoria asignada permite la estructura *TYPE* más
   *size* ("Py_ssize_t") campos del tamaño dado por el campo
   "tp_itemsize" de *typeobj*. Esto es útil para implementar objetos
   como las tuplas, que pueden determinar su tamaño en el momento de
   la construcción. Integrar el arreglo de campos en la misma
   asignación disminuye el número de asignaciones, mejorando la
   eficiencia de la gestión de memoria.

   Note that this function is unsuitable if *typeobj* has
   "Py_TPFLAGS_HAVE_GC" set. For such objects, use
   "PyObject_GC_NewVar()" instead.

PyObject _Py_NoneStruct

   Objeto que es visible en Python como "None". Esto solo se debe
   acceder utilizando el macro "Py_None", que se evalúa como un
   puntero a este objeto.

Ver también:

  Objetos módulo
     Para asignar y crear módulos de extensión.


Deprecated aliases
==================

These are *soft deprecated* aliases to existing functions and macros.
They exist solely for backwards compatibility.

+----------------------------------------------------+----------------------------------------------------+
| Deprecated alias                                   | Function                                           |
|====================================================|====================================================|
| PyObject_NEW(type, typeobj)                        | "PyObject_New"                                     |
+----------------------------------------------------+----------------------------------------------------+
| PyObject_NEW_VAR(type, typeobj, n)                 | "PyObject_NewVar"                                  |
+----------------------------------------------------+----------------------------------------------------+
| PyObject_INIT(op, typeobj)                         | "PyObject_Init()"                                  |
+----------------------------------------------------+----------------------------------------------------+
| PyObject_INIT_VAR(op, typeobj, n)                  | "PyObject_InitVar()"                               |
+----------------------------------------------------+----------------------------------------------------+
| PyObject_MALLOC(n)                                 | "PyObject_Malloc()"                                |
+----------------------------------------------------+----------------------------------------------------+
| PyObject_REALLOC(p, n)                             | "PyObject_Realloc()"                               |
+----------------------------------------------------+----------------------------------------------------+
| PyObject_FREE(p)                                   | "PyObject_Free()"                                  |
+----------------------------------------------------+----------------------------------------------------+
| PyObject_DEL(p)                                    | "PyObject_Free()"                                  |
+----------------------------------------------------+----------------------------------------------------+
| PyObject_Del(p)                                    | "PyObject_Free()"                                  |
+----------------------------------------------------+----------------------------------------------------+
