numpy 2.0.0
include/numpy/npy_3kcompat.h File Reference
#include <Python.h>
#include <stdio.h>
#include "numpy/npy_common.h"
#include "numpy/ndarrayobject.h"

Go to the source code of this file.

Defines

#define PyBytes_Type   PyString_Type
#define PyBytes_Check   PyString_Check
#define PyBytesObject   PyStringObject
#define PyBytes_FromString   PyString_FromString
#define PyBytes_FromStringAndSize   PyString_FromStringAndSize
#define PyBytes_AS_STRING   PyString_AS_STRING
#define PyBytes_AsStringAndSize   PyString_AsStringAndSize
#define PyBytes_FromFormat   PyString_FromFormat
#define PyBytes_Concat   PyString_Concat
#define PyBytes_ConcatAndDel   PyString_ConcatAndDel
#define PyBytes_AsString   PyString_AsString
#define PyBytes_GET_SIZE   PyString_GET_SIZE
#define PyBytes_Size   PyString_Size
#define PyUString_Type   PyString_Type
#define PyUString_Check   PyString_Check
#define PyUStringObject   PyStringObject
#define PyUString_FromString   PyString_FromString
#define PyUString_FromStringAndSize   PyString_FromStringAndSize
#define PyUString_FromFormat   PyString_FromFormat
#define PyUString_Concat   PyString_Concat
#define PyUString_ConcatAndDel   PyString_ConcatAndDel
#define PyUString_GET_SIZE   PyString_GET_SIZE
#define PyUString_Size   PyString_Size
#define PyUString_InternFromString   PyString_InternFromString
#define PyUString_Format   PyString_Format
#define Py_TYPE(o)   (((PyObject*)(o))->ob_type)
#define Py_REFCNT(o)   (((PyObject*)(o))->ob_refcnt)
#define Py_SIZE(o)   (((PyVarObject*)(o))->ob_size)
#define npy_PyFile_Dup(file, mode)   PyFile_AsFile(file)
#define npy_PyFile_DupClose(file, handle)   (0)
#define npy_PyFile_Check   PyFile_Check

Functions

static NPY_INLINE void PyUnicode_ConcatAndDel (PyObject **left, PyObject *right)
static NPY_INLINE void PyUnicode_Concat2 (PyObject **left, PyObject *right)
static NPY_INLINE PyObject * npy_PyFile_OpenFile (PyObject *filename, char *mode)
static NPY_INLINE PyObject * NpyCapsule_FromVoidPtr (void *ptr, void(*dtor)(void *))
static NPY_INLINE PyObject * NpyCapsule_FromVoidPtrAndDesc (void *ptr, void *context, void(*dtor)(void *, void *))
static NPY_INLINE void * NpyCapsule_AsVoidPtr (PyObject *ptr)
static NPY_INLINE void * NpyCapsule_GetDesc (PyObject *obj)
static NPY_INLINE int NpyCapsule_Check (PyObject *ptr)
static NPY_INLINE void simple_capsule_dtor (void *ptr)

Define Documentation

#define npy_PyFile_Check   PyFile_Check
#define npy_PyFile_Dup (   file,
  mode 
)    PyFile_AsFile(file)
PyFile_* compatibility
#define npy_PyFile_DupClose (   file,
  handle 
)    (0)
#define Py_REFCNT (   o)    (((PyObject*)(o))->ob_refcnt)
#define Py_SIZE (   o)    (((PyVarObject*)(o))->ob_size)
#define PyBytes_AS_STRING   PyString_AS_STRING
#define PyBytes_AsString   PyString_AsString
#define PyBytes_AsStringAndSize   PyString_AsStringAndSize
#define PyBytes_Check   PyString_Check
#define PyBytes_Concat   PyString_Concat
#define PyBytes_ConcatAndDel   PyString_ConcatAndDel
#define PyBytes_FromFormat   PyString_FromFormat
#define PyBytes_FromString   PyString_FromString
#define PyBytes_FromStringAndSize   PyString_FromStringAndSize
#define PyBytes_GET_SIZE   PyString_GET_SIZE

Referenced by voidtype_item().

#define PyBytes_Size   PyString_Size
#define PyBytes_Type   PyString_Type
PyInt -> PyLong

<

NPY_PY3K
PyString -> PyBytes
#define PyBytesObject   PyStringObject
#define PyUString_Check   PyString_Check

Referenced by arraydescr_str().

#define PyUString_Concat   PyString_Concat
#define PyUString_Format   PyString_Format
NPY_PY3K
#define PyUString_FromFormat   PyString_FromFormat
#define PyUString_FromStringAndSize   PyString_FromStringAndSize
#define PyUString_GET_SIZE   PyString_GET_SIZE
#define PyUString_InternFromString   PyString_InternFromString

Referenced by _extract_pyvals().

#define PyUString_Size   PyString_Size
#define PyUString_Type   PyString_Type
#define PyUStringObject   PyStringObject

Function Documentation

static NPY_INLINE PyObject* npy_PyFile_OpenFile ( PyObject *  filename,
char *  mode 
) [static]
static NPY_INLINE void* NpyCapsule_AsVoidPtr ( PyObject *  ptr) [static]
static NPY_INLINE int NpyCapsule_Check ( PyObject *  ptr) [static]

Referenced by PyArray_GetCastFunc().

static NPY_INLINE PyObject* NpyCapsule_FromVoidPtr ( void *  ptr,
void(*)(void *)  dtor 
) [static]
PyObject_Cmp
PyCObject functions adapted to PyCapsules.
The main job here is to get rid of the improved error handling of PyCapsules. It's a shame...

Referenced by can_cast_timedelta64_units().

static NPY_INLINE PyObject* NpyCapsule_FromVoidPtrAndDesc ( void *  ptr,
void *  context,
void(*)(void *, void *)  dtor 
) [static]
static NPY_INLINE void* NpyCapsule_GetDesc ( PyObject *  obj) [static]
static NPY_INLINE void PyUnicode_Concat2 ( PyObject **  left,
PyObject *  right 
) [static]
static NPY_INLINE void PyUnicode_ConcatAndDel ( PyObject **  left,
PyObject *  right 
) [static]
static NPY_INLINE void simple_capsule_dtor ( void *  ptr) [static]
_NPY_3KCOMPAT_H_

Referenced by can_cast_timedelta64_units().