numpy  2.0.0
src/multiarray/scalartypes.c.src File Reference
#include "Python.h"
#include "structmember.h"
#include "numpy/arrayobject.h"
#include "numpy/npy_math.h"
#include "numpy/halffloat.h"
#include "numpy/arrayscalars.h"
#include "npy_pycompat.h"
#include "npy_config.h"
#include "mapping.h"
#include "ctors.h"
#include "usertypes.h"
#include "numpyos.h"
#include "common.h"
#include "scalartypes.h"
#include "_datetime.h"
#include "datetime_strings.h"
#include <stdlib.h>

Data Structures

struct  scalar_type

Defines

#define PY_SSIZE_T_CLEAN
#define NPY_NO_DEPRECATED_API   NPY_API_VERSION
#define _MULTIARRAYMODULE
#define _FMT1   "%%.%i" NPY_@NAME@_FMT
#define _FMT2   "%%+.%i" NPY_@NAME@_FMT
#define _FMT1   "%%.%i" NPY_@NAME@_FMT
#define _FMT2   "%%+.%i" NPY_@NAME@_FMT
#define HALFPREC_REPR   5
#define HALFPREC_STR   5
#define FLOATPREC_REPR   8
#define FLOATPREC_STR   6
#define DOUBLEPREC_REPR   17
#define DOUBLEPREC_STR   12
#define LONGDOUBLEPREC_REPR   DOUBLEPREC_REPR
#define LONGDOUBLEPREC_STR   DOUBLEPREC_STR
#define PREC   @NAME@PREC_@KIND@
#define BASEFLAGS   Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_CHECKTYPES
#define LEAFFLAGS   Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES
#define _WORK(num)
#define _WORK1   _WORK(1)
#define _WORKz   _WORK(0)
#define _WORK0
#define _NPY_UNUSED2_1
#define _NPY_UNUSED2_z
#define _NPY_UNUSED2_0   NPY_UNUSED
#define _NPY_UNUSED1_0
#define _NPY_UNUSED1_1
#define _NPY_UNUSED1_2   NPY_UNUSED
#define NAME_bool   "bool"
#define NAME_void   "void"
#define NAME_string   "string"
#define NAME_unicode   "unicode"
#define _THIS_DOC   "Composed of two " _THIS_SIZE2 " bit floats"
#define NPY_SIZEOF_BYTE   1
#define _FROM_BSIZE   NPY_SIZEOF_@FROM_BASENAME@
#define _FROM_NUM   (NPY_@FROM_NAME@)
#define _TO_BSIZE   NPY_SIZEOF_@TO_BASENAME@
#define _TO_NUM   (NPY_@TO_NAME@)

Functions

static PyObject * gentype_alloc (PyTypeObject *type, Py_ssize_t nitems)
static void gentype_dealloc (PyObject *v)
static void gentype_free (PyObject *v)
static PyObject * gentype_power (PyObject *m1, PyObject *m2, PyObject *NPY_UNUSED(m3))
static PyObject * gentype_generic_method (PyObject *self, PyObject *args, PyObject *kwds, char *str)
static PyObject *gentype_ name (PyObject *m1, PyObject *m2)
static PyObject * gentype_multiply (PyObject *m1, PyObject *m2)
static PyObject *gentype_ name (PyObject *m1)
static int gentype_nonzero_number (PyObject *m1)
static PyObject * gentype_str (PyObject *self)
static PyObject * gentype_repr (PyObject *self)
static PyObject * gentype_format (PyObject *self, PyObject *args)
NPY_NO_EXPORT void format_ name (char *buf, size_t buflen,@type @val, unsigned int prec)
NPY_NO_EXPORT void format_half (char *buf, size_t buflen, npy_half val, unsigned int prec)
static PyObject *name type_ form (PyObject *self)
static PyObject * datetimetype_repr (PyObject *self)
static PyObject * timedeltatype_repr (PyObject *self)
static PyObject * datetimetype_str (PyObject *self)
static PyObject * timedeltatype_str (PyObject *self)
static PyObject *name type_ kind (PyObject *self)
static int name type_print (PyObject *v, FILE *fp, int flags)
static PyObject * gentype_richcompare (PyObject *self, PyObject *other, int cmp_op)
static PyObject * gentype_ndim_get (PyObject *NPY_UNUSED(self))
static PyObject * gentype_flags_get (PyObject *NPY_UNUSED(self))
static PyObject * voidtype_flags_get (PyVoidScalarObject *self)
static PyObject * voidtype_dtypedescr_get (PyVoidScalarObject *self)
static PyObject * inttype_numerator_get (PyObject *self)
static PyObject * inttype_denominator_get (PyObject *self)
static PyObject * gentype_data_get (PyObject *self)
static PyObject * gentype_itemsize_get (PyObject *self)
static PyObject * gentype_size_get (PyObject *NPY_UNUSED(self))
static PyObject * gentype_sizeof (PyObject *self)
NPY_NO_EXPORT void gentype_struct_free (void *ptr, void *arg)
static PyObject * gentype_struct_get (PyObject *self)
static PyObject * gentype_priority_get (PyObject *NPY_UNUSED(self))
static PyObject * gentype_shape_get (PyObject *NPY_UNUSED(self))
static PyObject * gentype_interface_get (PyObject *self)
static PyObject * gentype_typedescr_get (PyObject *self)
static PyObject * gentype_base_get (PyObject *NPY_UNUSED(self))
static PyObject * voidtype_base_get (PyVoidScalarObject *self)
static PyArray_Descr_realdescr_fromcomplexscalar (PyObject *self, int *typenum)
static PyObject * gentype_real_get (PyObject *self)
static PyObject * gentype_imag_get (PyObject *self)
static PyObject * gentype_flat_get (PyObject *self)
static PyObject * gentype_transpose_get (PyObject *self)
static PyObject * gentype_getarray (PyObject *scalar, PyObject *args)
static PyObject * gentype_wraparray (PyObject *NPY_UNUSED(scalar), PyObject *args)
static PyObject * gentype_itemset (PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args))
static PyObject * gentype_squeeze (PyObject *self, PyObject *args)
static Py_ssize_t gentype_getreadbuf (PyObject *, Py_ssize_t, void **)
static PyObject * gentype_byteswap (PyObject *self, PyObject *args)
static PyObject *gentype_ name (PyObject *self, PyObject *args, PyObject *kwds)
static PyObject * voidtype_getfield (PyVoidScalarObject *self, PyObject *args, PyObject *kwds)
static PyObject * gentype_setfield (PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), PyObject *NPY_UNUSED(kwds))
static PyObject * voidtype_setfield (PyVoidScalarObject *self, PyObject *args, PyObject *kwds)
static PyObject * gentype_reduce (PyObject *self, PyObject *NPY_UNUSED(args))
static PyObject * gentype_setstate (PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args))
static PyObject * gentype_dump (PyObject *self, PyObject *args)
static PyObject * gentype_dumps (PyObject *self, PyObject *args)
static PyObject * gentype_setflags (PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), PyObject *NPY_UNUSED(kwds))
static PyObject *name _complex (PyObject *self, PyObject *NPY_UNUSED(args), PyObject *NPY_UNUSED(kwds))
static Py_ssize_t voidtype_length (PyVoidScalarObject *self)
static PyObject * voidtype_subscript (PyVoidScalarObject *self, PyObject *ind)
static PyObject * voidtype_item (PyVoidScalarObject *self, Py_ssize_t n)
static int voidtype_ass_subscript (PyVoidScalarObject *self, PyObject *ind, PyObject *val)
static int voidtype_ass_item (PyVoidScalarObject *self, Py_ssize_t n, PyObject *val)
static Py_ssize_t gentype_getsegcount (PyObject *self, Py_ssize_t *lenp)
static Py_ssize_t gentype_getcharbuf (PyObject *self, Py_ssize_t segment, constchar **ptrptr)
static int gentype_getbuffer (PyObject *self, Py_buffer *view, int flags)
static void void_dealloc (PyVoidScalarObject *v)
static void object_arrtype_dealloc (PyObject *v)
static PyObject *name _arrtype_new (PyTypeObject *_NPY_UNUSED1_ @default @(type), PyObject *args, PyObject *_NPY_UNUSED2_ @work @(kwds))
static PyObject *name _arrtype_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
static PyObject * bool_arrtype_new (PyTypeObject *NPY_UNUSED(type), PyObject *args, PyObject *NPY_UNUSED(kwds))
static PyObject * bool_arrtype_and (PyObject *a, PyObject *b)
static PyObject * bool_arrtype_or (PyObject *a, PyObject *b)
static PyObject * bool_arrtype_xor (PyObject *a, PyObject *b)
static int bool_arrtype_nonzero (PyObject *a)
static PyObject *name _index (PyObject *self)
static PyObject * bool_index (PyObject *a)
static PyObject * void_arrtype_new (PyTypeObject *type, PyObject *args, PyObject *NPY_UNUSED(kwds))
static npy_hash_t lname _arrtype_hash (PyObject *obj)
static npy_hash_t ulong_arrtype_hash (PyObject *obj)
static NPY_INLINE npy_hash_t char longlong_arrtype_hash (PyObject *obj)
static npy_hash_t half_arrtype_hash (PyObject *obj)
static npy_hash_t object_arrtype_hash (PyObject *obj)
static npy_hash_t void_arrtype_hash (PyObject *obj)
static PyObject * object_arrtype_getattro (PyObjectScalarObject *obj, PyObject *attr)
static int object_arrtype_setattro (PyObjectScalarObject *obj, PyObject *attr, PyObject *val)
static PyObject * object_arrtype_concat (PyObjectScalarObject *self, PyObject *other)
static Py_ssize_t object_arrtype_length (PyObjectScalarObject *self)
static PyObject * object_arrtype_repeat (PyObjectScalarObject *self, Py_ssize_t count)
static PyObject * object_arrtype_subscript (PyObjectScalarObject *self, PyObject *key)
static int object_arrtype_ass_subscript (PyObjectScalarObject *self, PyObject *key, PyObject *value)
static int object_arrtype_contains (PyObjectScalarObject *self, PyObject *ob)
static PyObject * object_arrtype_inplace_concat (PyObjectScalarObject *self, PyObject *o)
static PyObject * object_arrtype_inplace_repeat (PyObjectScalarObject *self, Py_ssize_t count)
static Py_ssize_t object_arrtype_getsegcount (PyObjectScalarObject *self, Py_ssize_t *lenp)
static Py_ssize_t object_arrtype_getreadbuf (PyObjectScalarObject *self, Py_ssize_t segment, void **ptrptr)
static Py_ssize_t object_arrtype_getwritebuf (PyObjectScalarObject *self, Py_ssize_t segment, void **ptrptr)
static Py_ssize_t object_arrtype_getcharbuf (PyObjectScalarObject *self, Py_ssize_t segment, constchar **ptrptr)
static int object_arrtype_getbuffer (PyObjectScalarObject *self, Py_buffer *view, int flags)
static void object_arrtype_releasebuffer (PyObjectScalarObject *self, Py_buffer *view)
static PyObject * object_arrtype_call (PyObjectScalarObject *obj, PyObject *args, PyObject *kwds)
static PyObject * gen_arrtype_subscript (PyObject *self, PyObject *key)
NPY_NO_EXPORT void initialize_casting_tables (void)
static void init_basetypes (void)
NPY_NO_EXPORT void initialize_numeric_types (void)
static int compare_types (const void *a_, const void *b_)
NPY_NO_EXPORT int get_typeobj_idx (PyTypeObject *obj)
NPY_NO_EXPORT int is_anyscalar_exact (PyObject *obj)
NPY_NO_EXPORT int _typenum_fromtypeobj (PyObject *type, int user)

Variables

NPY_NO_EXPORT PyBoolScalarObject _PyArrayScalar_BoolValues []
NPY_NO_EXPORT PyTypeObject PyTimeIntegerArrType_Type
NPY_NO_EXPORT PyTypeObject Py NAME ArrType_Type
static char * _datetime_verbose_strings [NPY_DATETIME_NUMUNITS]
static PyNumberMethods gentype_as_number
static PyGetSetDef gentype_getsets []
static char doc_getarray [] = "sc.__array__(|type) return 0-dim array"
static char doc_sc_wraparray [] = "sc.__array_wrap__(obj) return scalar from array"
static PyMethodDef gentype_methods []
static PyGetSetDef voidtype_getsets []
static PyMethodDef voidtype_methods []
static PyGetSetDef inttype_getsets []
static PyMethodDef name type_methods []
static PyMappingMethods voidtype_as_mapping
static PySequenceMethods voidtype_as_sequence
static PyBufferProcs gentype_as_buffer
NPY_NO_EXPORT PyTypeObject PyGenericArrType_Type
static PyNumberMethods name _arrtype_as_number
NPY_NO_EXPORT PyNumberMethods bool_arrtype_as_number
static PySequenceMethods object_arrtype_as_sequence
static PyMappingMethods object_arrtype_as_mapping
static PyBufferProcs object_arrtype_as_buffer
NPY_NO_EXPORT PyTypeObject PyObjectArrType_Type
static PyMappingMethods gentype_as_mapping
NPY_NO_EXPORT signed char _npy_scalar_kinds_table [NPY_NTYPES]
NPY_NO_EXPORT signed char _npy_smallest_type_of_kind_table [NPY_NSCALARKINDS]
NPY_NO_EXPORT signed char _npy_next_larger_type_table [NPY_NTYPES]
NPY_NO_EXPORT unsigned char _npy_can_cast_safely_table [NPY_NTYPES][NPY_NTYPES]
NPY_NO_EXPORT signed char _npy_type_promotion_table [NPY_NTYPES][NPY_NTYPES]
static PyNumberMethods longdoubletype_as_number
static PyNumberMethods clongdoubletype_as_number
static scalar_type typeobjects []

Define Documentation

#define _FMT1   "%%.%i" NPY_@NAME@_FMT
begin repeat
name = float, double, longdouble# #NAME = FLOAT, DOUBLE, LONGDOUBLE# #type = npy_float, npy_double, npy_longdouble# suff = f, d, l#
end repeat*
begin repeat
name = cfloat, cdouble, clongdouble# #NAME = FLOAT, DOUBLE, LONGDOUBLE# #type = npy_cfloat, npy_cdouble, npy_clongdouble# suff = f, d, l#
#define _FMT1   "%%.%i" NPY_@NAME@_FMT
begin repeat
name = float, double, longdouble# #NAME = FLOAT, DOUBLE, LONGDOUBLE# #type = npy_float, npy_double, npy_longdouble# suff = f, d, l#
end repeat*
begin repeat
name = cfloat, cdouble, clongdouble# #NAME = FLOAT, DOUBLE, LONGDOUBLE# #type = npy_cfloat, npy_cdouble, npy_clongdouble# suff = f, d, l#
#define _FMT2   "%%+.%i" NPY_@NAME@_FMT
#define _FMT2   "%%+.%i" NPY_@NAME@_FMT
#define _FROM_BSIZE   NPY_SIZEOF_@FROM_BASENAME@
#define _FROM_NUM   (NPY_@FROM_NAME@)

Referenced by _arrtype_hash().

#define _NPY_UNUSED1_0
#define _NPY_UNUSED1_1
#define _NPY_UNUSED1_2   NPY_UNUSED
#define _NPY_UNUSED2_0   NPY_UNUSED
#define _NPY_UNUSED2_1
begin repeat
name = byte, short, int, long, longlong, ubyte, ushort, uint, ulong,
ulonglong, half, float, double, longdouble, cfloat, cdouble, clongdouble, string, unicode, object#
#Name = Byte, Short, Int, Long, LongLong, UByte, UShort, UInt, ULong,
ULongLong, Half, Float, Double, LongDouble, CFloat, CDouble, CLongDouble, String, Unicode, Object#
TYPE = BYTE, SHORT, INT, LONG, LONGLONG, UBYTE, USHORT, UINT, ULONG,
ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, OBJECT#
System Message: WARNING/2 (<string>, line 11) Definition list ends without a blank line; unexpected unindent.

#work = 0,0,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,z,z,0# #default = 0*17,1*2,2#

#define _NPY_UNUSED2_z
#define _THIS_DOC   "Composed of two " _THIS_SIZE2 " bit floats"
begin repeat
#NAME = CFloat, CDouble, CLongDouble# name = complex*3# #CNAME = FLOAT, DOUBLE, LONGDOUBLE#
#define _TO_BSIZE   NPY_SIZEOF_@TO_BASENAME@
#define _TO_NUM   (NPY_@TO_NAME@)

Referenced by _arrtype_hash().

#define _WORK (   num)
Value:
if (type->tp_bases && (PyTuple_GET_SIZE(type->tp_bases)==2)) { \
        PyTypeObject *sup; \ \
        sup = (PyTypeObject *)PyTuple_GET_ITEM(type->tp_bases, num); \ \
        if (thisfunc != sup->tp_new) { \
            robj = sup->tp_new(type, args, kwds); \
            if (robj != NULL) goto finish;        \
            if (PyTuple_GET_SIZE(args)!=1) return NULL; \
            PyErr_Clear(); \
        } \ \
    }
string and unicode inherit from Python Type first and so GET_ITEM is different to get to the Python Type.

ok is a work-around for a bug in complex_new that doesn't allocate
memory from the sub-types memory allocator.
#define _WORK0
#define _WORK1   _WORK(1)
#define _WORKz   _WORK(0)
#define BASEFLAGS   Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_CHECKTYPES
#define DOUBLEPREC_REPR   17
#define DOUBLEPREC_STR   12
#define FLOATPREC_REPR   8
#define FLOATPREC_STR   6
#define HALFPREC_REPR   5
The REPR values are finfo.precision + 2
#define HALFPREC_STR   5
#define LEAFFLAGS   Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES
#define NAME_bool   "bool"
#define NAME_string   "string"
#define NAME_unicode   "unicode"
#define NAME_void   "void"
#define NPY_NO_DEPRECATED_API   NPY_API_VERSION
#define NPY_SIZEOF_BYTE   1
#define PREC   @NAME@PREC_@KIND@
float type str and repr
These functions will return NULL if PyString creation fails.
begin repeat
name = half, float, double, longdouble# #Name = Half, Float, Double, LongDouble# #NAME = HALF, FLOAT, DOUBLE, LONGDOUBLE# #hascomplex = 0, 1, 1, 1#
begin repeat1
kind = str, repr# #KIND = STR, REPR#

Referenced by datetimetype_repr(), and form().


Function Documentation

static npy_hash_t c lname _arrtype_hash ( PyObject *  obj) [static]
********** Define Hash functions ***************
begin repeat
#lname = bool, ubyte, ushort# name = Bool,UByte, UShort#
end repeat*
begin repeat
#lname = byte, short, uint# name = Byte, Short, UInt#
end repeat*
begin repeat
#lname = datetime, timedelta# name = Datetime, Timedelta#
end repeat*
Wrong thing to do for longdouble, but....
begin repeat
#lname = float, longdouble# name = Float, LongDouble#
borrowed from complex_hash

References _FROM_NUM, _TO_NUM, NPY_DATETIME, NPY_NTYPES, NPY_STRING, NPY_TIMEDELTA, NPY_UNICODE, and NPY_VOID.

static PyObject* name _arrtype_new ( PyTypeObject *_NPY_UNUSED1_ @default @  type,
PyObject *  args,
PyObject *_NPY_UNUSED2_ @work @  kwds 
) [static]
allow base-class (if any) to do conversion If successful, this will jump to finish:
typecode is new reference and stolen by PyArray_FromAny but not PyArray_Scalar
It is expected at this point that robj is a PyArrayScalar (even for Object Data Type)
0-d array
In OBJECT case, robj is no longer a PyArrayScalar at this point but the remaining code assumes it is
Normal return
This return path occurs when the requested type is not created but another scalar object is created instead (i.e. when the base-class does the conversion in _WORK macro)
Need to allocate new type and copy data-area over
typecode will be NULL
static PyObject* name _arrtype_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwds 
) [static]
end repeat*
begin repeat
name = datetime, timedelta# #Name = Datetime, Timedelta# #NAME = DATETIME, TIMEDELTA# #is_datetime = 1, 0#
Allocate the return scalar
Incorporate the metadata if its provided
Parse the provided metadata input
A unit of -1 signals that convert_pyobject_to_datetime should populate.
Make datetime default to NaT, timedelta default to zero
static PyObject* name _complex ( PyObject *  self,
PyObject *  NPY_UNUSEDargs,
PyObject *  NPY_UNUSEDkwds 
) [static]
casting complex numbers (that don't inherit from Python complex) to Python complex
begin repeat
name = cfloat, clongdouble# #Name = CFloat, CLongDouble#
static PyObject* name _index ( PyObject *  self) [static]
static PyArray_Descr* _realdescr_fromcomplexscalar ( PyObject *  self,
int *  typenum 
) [static]
NPY_NO_EXPORT int _typenum_fromtypeobj ( PyObject *  type,
int  user 
)
Search any registered types
static PyObject* bool_arrtype_and ( PyObject *  a,
PyObject *  b 
) [static]
static PyObject* bool_arrtype_new ( PyTypeObject *  NPY_UNUSEDtype,
PyObject *  args,
PyObject *  NPY_UNUSEDkwds 
) [static]
end repeat*
bool->tp_new only returns Py_True or Py_False
static int bool_arrtype_nonzero ( PyObject *  a) [static]
static PyObject* bool_arrtype_or ( PyObject *  a,
PyObject *  b 
) [static]
static PyObject* bool_arrtype_xor ( PyObject *  a,
PyObject *  b 
) [static]
static PyObject* bool_index ( PyObject *  a) [static]
end repeat*
static int compare_types ( const void *  a_,
const void *  b_ 
) [static]
static PyObject* datetimetype_repr ( PyObject *  self) [static]
end repeat*
For straight units or generic units, the unit will be deduced from the string, so it's not necessary to specify it.

References name, PREC, and PyUString_FromString.

static PyObject* datetimetype_str ( PyObject *  self) [static]
static PyObject* name type_ form ( PyObject *  self) [static]
over-ride repr and str of array-scalar strings and unicode to remove NULL bytes and then call the corresponding functions of string and unicode.
begin repeat
name = string*2,unicode*2# form = (repr,str)*2# #Name = String*2,Unicode*2# #NAME = STRING*2,UNICODE*2# #extra = AndSize*2,,# #type = npy_char*2, Py_UNICODE*2#

References name, PREC, and PyUString_FromString.

NPY_NO_EXPORT void format_half ( char *  buf,
size_t  buflen,
npy_half  val,
unsigned int  prec 
)
end repeat*
static PyObject* gen_arrtype_subscript ( PyObject *  self,
PyObject *  key 
) [static]
Only [...], [...,<???>], [<???>, ...], is allowed for indexing a scalar
These return a new N-d array with a copy of the data where N is the number of None's in <???>.
static PyObject* gentype_alloc ( PyTypeObject *  type,
Py_ssize_t  nitems 
) [static]
end repeat*
Fixme. Need to check for no memory. If we don't need to zero memory, we could use PyObject_{New, NewVar} for this whole function.

References PyArray_PyIntAsIntp().

static PyObject* gentype_base_get ( PyObject *  NPY_UNUSEDself) [static]
static PyObject* gentype_byteswap ( PyObject *  self,
PyObject *  args 
) [static]
get the data, copyswap it and pass it to a new Array scalar

References gentype_format().

static PyObject* gentype_data_get ( PyObject *  self) [static]
static void gentype_dealloc ( PyObject *  v) [static]

References PyArray_PyIntAsIntp().

static PyObject* gentype_dump ( PyObject *  self,
PyObject *  args 
) [static]

Referenced by gentype_wraparray().

static PyObject* gentype_dumps ( PyObject *  self,
PyObject *  args 
) [static]
static PyObject* gentype_flags_get ( PyObject *  NPY_UNUSEDself) [static]
static PyObject* gentype_flat_get ( PyObject *  self) [static]
static PyObject* gentype_format ( PyObject *  self,
PyObject *  args 
) [static]
The __format__ method for PEP 3101.
Convert to an appropriate Python type and call its format. TODO: For some types, like long double, this isn't right,

System Message: ERROR/3 (<string>, line 3) Unexpected indentation.

<blockquote> because it throws away precision.</blockquote>

Referenced by gentype_byteswap().

static void gentype_free ( PyObject *  v) [static]
have an explicit tp_free to enforce inheritance from it. PyObject_Free is also the tp_free of PyBaseObject so python does not COPYSLOT it, instead it takes the next parent PyInt which has a different allocator
static PyObject* gentype_generic_method ( PyObject *  self,
PyObject *  args,
PyObject *  kwds,
char *  str 
) [static]

Referenced by inttype_numerator_get().

static PyObject* gentype_getarray ( PyObject *  scalar,
PyObject *  args 
) [static]
static int gentype_getbuffer ( PyObject *  self,
Py_buffer *  view,
int  flags 
) [static]
FIXME: XXX: the format is not implemented! -- this needs more work
static Py_ssize_t gentype_getcharbuf ( PyObject *  self,
Py_ssize_t  segment,
constchar **  ptrptr 
) [static]
!defined(NPY_PY3K)
static Py_ssize_t gentype_getreadbuf ( PyObject *  self,
Py_ssize_t  segment,
void **  ptrptr 
) [static]
static Py_ssize_t gentype_getsegcount ( PyObject *  self,
Py_ssize_t *  lenp 
) [static]
static PyObject* gentype_imag_get ( PyObject *  self) [static]
static PyObject* gentype_interface_get ( PyObject *  self) [static]
static PyObject* gentype_itemset ( PyObject *  NPY_UNUSEDself,
PyObject *  NPY_UNUSEDargs 
) [static]
end repeat*
static PyObject* gentype_itemsize_get ( PyObject *  self) [static]
static PyObject* gentype_multiply ( PyObject *  m1,
PyObject *  m2 
) [static]
end repeat*
If the other object supports sequence repeat and not number multiply we should call sequence repeat to support e.g. list repeat by numpy scalars (they may be converted to ndarray otherwise). A python defined class will always only have the nb_multiply slot and some classes may have neither defined. For the latter we want need to give the normal case a chance to convert the object to ndarray. Probably no class has both defined, but if they do, prefer number.
Try to convert m2 to an int and try sequence repeat
Note that npy_intp is compatible to Py_Ssize_t
Try to convert m1 to an int and try sequence repeat
All normal cases are handled by PyArray's multiply
static PyObject* gentype_ndim_get ( PyObject *  NPY_UNUSEDself) [static]
static int gentype_nonzero_number ( PyObject *  m1) [static]
end repeat*
static PyObject* gentype_power ( PyObject *  m1,
PyObject *  m2,
PyObject *  NPY_UNUSEDm3 
) [static]
static PyObject* gentype_priority_get ( PyObject *  NPY_UNUSEDself) [static]
static PyObject* gentype_real_get ( PyObject *  self) [static]
static PyObject* gentype_reduce ( PyObject *  self,
PyObject *  NPY_UNUSEDargs 
) [static]
Return a tuple of (callable object, arguments)
We need to expand the buffer so that we always write UCS4 to disk for pickle of unicode scalars.
This could be in a unicode_reduce function, but that would require re-factoring.

Referenced by gentype_getarray().

static PyObject* gentype_repr ( PyObject *  self) [static]
XXX: Why are we using str here?
static PyObject* gentype_richcompare ( PyObject *  self,
PyObject *  other,
int  cmp_op 
) [static]
If the other object is None, False is always right. This avoids the array None comparison, at least until deprecation it is fixed. After that, this may be removed and numpy false would be returned.

NOTE: np.equal(NaT, None) evaluates to TRUE! This is an
an inconsistency, which may has to be considered when the deprecation is finished.
Call via PyObject_RichCompare to ensure that other.__eq__ has a chance to run when necessary
static PyObject* gentype_setfield ( PyObject *  NPY_UNUSEDself,
PyObject *  NPY_UNUSEDargs,
PyObject *  NPY_UNUSEDkwds 
) [static]
static PyObject* gentype_setflags ( PyObject *  NPY_UNUSEDself,
PyObject *  NPY_UNUSEDargs,
PyObject *  NPY_UNUSEDkwds 
) [static]
setting flags cannot be done for scalars
static PyObject* gentype_setstate ( PyObject *  NPY_UNUSEDself,
PyObject *  NPY_UNUSEDargs 
) [static]
ignores everything

Referenced by gentype_getarray().

static PyObject* gentype_shape_get ( PyObject *  NPY_UNUSEDself) [static]
static PyObject* gentype_size_get ( PyObject *  NPY_UNUSEDself) [static]
static PyObject* gentype_sizeof ( PyObject *  self) [static]
static PyObject* gentype_squeeze ( PyObject *  self,
PyObject *  args 
) [static]

Referenced by gentype_wraparray().

static PyObject* gentype_str ( PyObject *  self) [static]
NPY_NO_EXPORT void gentype_struct_free ( void *  ptr,
void *  arg 
)
static PyObject* gentype_struct_get ( PyObject *  self) [static]
static PyObject* gentype_transpose_get ( PyObject *  self) [static]
static PyObject* gentype_typedescr_get ( PyObject *  self) [static]
static PyObject* gentype_wraparray ( PyObject *  NPY_UNUSEDscalar,
PyObject *  args 
) [static]
NPY_NO_EXPORT int get_typeobj_idx ( PyTypeObject *  obj)
static npy_hash_t half_arrtype_hash ( PyObject *  obj) [static]
end repeat*
static void init_basetypes ( void  ) [static]
Default for built-in types is object scalar
Default for next largest type is -1, signalling no bigger
Compile-time loop of scalar kinds
begin repeat
#NAME = BOOL,
BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE#
#BIGGERTYPE = -1,
NPY_SHORT, NPY_USHORT, NPY_INT, NPY_UINT, NPY_LONG, NPY_ULONG, NPY_LONGLONG, NPY_ULONGLONG, -1, -1, NPY_FLOAT, NPY_DOUBLE, NPY_LONGDOUBLE, -1, NPY_CDOUBLE, NPY_CLONGDOUBLE, -1#
#SCKIND = BOOL,
(INTNEG, INTPOS)*5, FLOAT*4, COMPLEX*3#
end repeat*
Identity
Bool -> <Anything> except datetime (since
it conceptually has no zero)
<Anything> -> Object
<Anything> -> Void
Compile-time loop of casting rules
begin repeat
#FROM_NAME = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
LONG, ULONG, LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE#
#FROM_BASENAME = BYTE, BYTE, SHORT, SHORT, INT, INT,
LONG, LONG, LONGLONG, LONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE, FLOAT, DOUBLE, LONGDOUBLE#
#from_isint = 1, 0, 1, 0, 1, 0, 1, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0#
#from_isuint = 0, 1, 0, 1, 0, 1, 0, 1,
0, 1, 0, 0, 0, 0, 0, 0, 0#
#from_isfloat = 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 1, 1, 1, 0, 0, 0#
#from_iscomplex = 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 1#
Allow casts from any integer to the TIMEDELTA type
begin repeat1
#TO_NAME = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
LONG, ULONG, LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE#
#TO_BASENAME = BYTE, BYTE, SHORT, SHORT, INT, INT,
LONG, LONG, LONGLONG, LONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE, FLOAT, DOUBLE, LONGDOUBLE#
#to_isint = 1, 0, 1, 0, 1, 0, 1, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0#
#to_isuint = 0, 1, 0, 1, 0, 1, 0, 1,
0, 1, 0, 0, 0, 0, 0, 0, 0#
#to_isfloat = 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 1, 1, 1, 0, 0, 0#
#to_iscomplex = 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 1#
NOTE: _FROM_BSIZE and _TO_BSIZE are the sizes of the "base type"
which is the same as the size of the type except for complex, where it is the size of the real type.
end repeat1*
end repeat*
Now that the _can_cast_safely table is finished, we can use it to build the _type_promotion table
Don't let number promote to string/unicode/void/datetime/timedelta
Promoting these types requires examining their contents
Except they can convert to OBJECT
Don't let number promote to string/unicode/void
If there's no kind (void/string/etc)
Start with the type of larger kind
Try the next larger type of this kind
If there is no larger, try a larger kind
Use -1 to signal no promoted type found

Referenced by test_interrupt().

need to add dummy versions with filled-in nb_index in-order for PyType_Ready to fill in .__index__() method also fill array_type_as_number struct with reasonable defaults
begin repeat
name = byte, short, int, long, longlong, ubyte, ushort,
uint, ulong, ulonglong#
#NAME = Byte, Short, Int, Long, LongLong, UByte, UShort,
UInt, ULong, ULongLong#
end repeat*
begin repeat
name = half, float, double, longdouble,
cfloat, cdouble, clongdouble#
#NAME = Half, Float, Double, LongDouble,
CFloat, CDouble, CLongDouble#
end repeat*
begin repeat
#NAME= Number, Integer, SignedInteger, UnsignedInteger, Inexact,
Floating, ComplexFloating, Flexible, Character#
end repeat*
begin repeat
name = bool, byte, short, int, long, longlong, ubyte, ushort, uint,
ulong, ulonglong, half, float, double, longdouble, cfloat, cdouble, clongdouble, string, unicode, void, object, datetime, timedelta#
#NAME = Bool, Byte, Short, Int, Long, LongLong, UByte, UShort, UInt,
ULong, ULongLong, Half, Float, Double, LongDouble, CFloat, CDouble, CLongDouble, String, Unicode, Void, Object, Datetime, Timedelta#
end repeat*
begin repeat
name = bool, byte, short, ubyte, ushort, uint, ulong, ulonglong,
half, float, longdouble, cfloat, clongdouble, void, object, datetime, timedelta#
#NAME = Bool, Byte, Short, UByte, UShort, UInt, ULong, ULongLong,
Half, Float, LongDouble, CFloat, CLongDouble, Void, Object, Datetime, Timedelta#
end repeat*
begin repeat
name = cfloat, clongdouble# #NAME = CFloat, CLongDouble#
end repeat*
begin repeat
name = repr, str#
end repeat*
These need to be coded specially because getitem does not return a normal Python type
begin repeat
name = int, float, repr, str# kind = tp_as_number->nb*2, tp*2#
end repeat*
begin repeat
name = long, hex, oct# kind = tp_as_number->nb*3#
end repeat*

Referenced by test_interrupt().

static PyObject* inttype_denominator_get ( PyObject *  self) [static]
static PyObject* inttype_numerator_get ( PyObject *  self) [static]
NPY_NO_EXPORT int is_anyscalar_exact ( PyObject *  obj)
static PyObject* name type_ kind ( PyObject *  self) [static]
static NPY_INLINE npy_hash_t char longlong_arrtype_hash ( PyObject *  obj) [static]
begin repeat
#char = ,u# #Char = ,U# #Word = ,Unsigned#

References NPY_NSCALARKINDS.

static PyObject *gentype_ name ( PyObject *  self,
PyObject *  args 
) [static]
begin repeat <blockquote>

name = add, subtract, remainder, divmod, lshift, rshift,
and, xor, or, floor_divide, true_divide#

</blockquote>

end repeat*
begin repeat <blockquote> name = divide#</blockquote>
These gentype_* functions do not take keyword arguments. The proper flag is METH_VARARGS.
begin repeat <blockquote>

name = tolist, item, tostring, tobytes, astype, copy, __deepcopy__,
searchsorted, view, swapaxes, conj, conjugate, nonzero, flatten, ravel, fill, transpose, newbyteorder#

</blockquote>

static PyObject *char longdoubletype_ name ( PyObject *  self) [static]
begin repeat <blockquote> name = positive, negative, absolute, invert, int, float#</blockquote>
end repeat*
begin repeat <blockquote> name = long, oct, hex#</blockquote>
end repeat*
Could improve this with a PyLong_FromLongDouble(longdouble ldval) but this would need some more work...
begin repeat <blockquote> name = (int, float)*2# #KIND = (Long, Float)*2# #char = ,,c*2# #CHAR = ,,C*2# #POST = ,,.real*2#</blockquote>
end repeat*
begin repeat <blockquote> name = (long, hex, oct)*2# #KIND = (Long*3)*2# #char = ,,,c*3# #CHAR = ,,,C*3# #POST = ,,,.real*3#</blockquote>
static void format_ name ( char *  buf,
size_t  buflen,
@type @  val,
unsigned int  prec 
)
XXX: Find a correct size here for format string
If nothing but digits after sign, append ".0"
XXX: Find a correct size here for format string
Ideally, we should handle this nan/inf stuff in NumpyOS_ascii_format*
FIXME We need a better way to handle the error message
FIXME We need a better way to handle the error message

References append_metastr_to_string(), PyDatetimeScalarObject::obmeta, PyUString_ConcatAndDel, and PyUString_FromString.

static PyObject* gentype_ name ( PyObject *  self,
PyObject *  args,
PyObject *  kwds 
) [static]
These gentype_* functions take keyword arguments. The proper flag is METH_VARARGS | METH_KEYWORDS.
begin repeat <blockquote>

name = take, getfield, put, repeat, tofile, mean, trace, diagonal, clip,
std, var, sum, cumsum, prod, cumprod, compress, sort, argsort, round, argmax, argmin, max, min, ptp, any, all, resize, reshape, choose#

</blockquote>

static int object_arrtype_ass_subscript ( PyObjectScalarObject self,
PyObject *  key,
PyObject *  value 
) [static]
static PyObject* object_arrtype_call ( PyObjectScalarObject obj,
PyObject *  args,
PyObject *  kwds 
) [static]
static PyObject* object_arrtype_concat ( PyObjectScalarObject self,
PyObject *  other 
) [static]

Referenced by object_arrtype_dealloc().

static int object_arrtype_contains ( PyObjectScalarObject self,
PyObject *  ob 
) [static]

References NPY_BYTE.

Referenced by object_arrtype_dealloc().

static PyObject* object_arrtype_getattro ( PyObjectScalarObject obj,
PyObject *  attr 
) [static]
object arrtype getattro and setattro
first look in object and then hand off to generic type
static int object_arrtype_getbuffer ( PyObjectScalarObject self,
Py_buffer *  view,
int  flags 
) [static]
static Py_ssize_t object_arrtype_getcharbuf ( PyObjectScalarObject self,
Py_ssize_t  segment,
constchar **  ptrptr 
) [static]
static Py_ssize_t object_arrtype_getreadbuf ( PyObjectScalarObject self,
Py_ssize_t  segment,
void **  ptrptr 
) [static]
static Py_ssize_t object_arrtype_getsegcount ( PyObjectScalarObject self,
Py_ssize_t *  lenp 
) [static]

References get_typeobj_idx().

static Py_ssize_t object_arrtype_getwritebuf ( PyObjectScalarObject self,
Py_ssize_t  segment,
void **  ptrptr 
) [static]
static npy_hash_t object_arrtype_hash ( PyObject *  obj) [static]
static PyObject* object_arrtype_inplace_concat ( PyObjectScalarObject self,
PyObject *  o 
) [static]

References NPY_LONG.

Referenced by object_arrtype_dealloc().

static PyObject* object_arrtype_inplace_repeat ( PyObjectScalarObject self,
Py_ssize_t  count 
) [static]

References NPY_LONGDOUBLE.

Referenced by object_arrtype_dealloc().

static Py_ssize_t object_arrtype_length ( PyObjectScalarObject self) [static]

Referenced by object_arrtype_dealloc().

static void object_arrtype_releasebuffer ( PyObjectScalarObject self,
Py_buffer *  view 
) [static]
static PyObject* object_arrtype_repeat ( PyObjectScalarObject self,
Py_ssize_t  count 
) [static]

Referenced by object_arrtype_dealloc().

static int object_arrtype_setattro ( PyObjectScalarObject obj,
PyObject *  attr,
PyObject *  val 
) [static]
first look in object and then hand off to generic type
static PyObject* object_arrtype_subscript ( PyObjectScalarObject self,
PyObject *  key 
) [static]
static PyObject* timedeltatype_repr ( PyObject *  self) [static]
The value
Can't use "lld" in Python < 2.7, Python3 < 3.2, or if HAVE_LONG_LONG is not defined
The metadata unit

References name.

static PyObject* timedeltatype_str ( PyObject *  self) [static]
Can't use "lld" in Python < 2.7, Python3 < 3.2, or if HAVE_LONG_LONG is not defined

References PyArray_FromScalar().

static int name type_print ( PyObject *  v,
FILE *  fp,
int  flags 
) [static]
end repeat1*
end repeat*
float type print (control print a, where a is a float type instance)
begin repeat
name = half, float, double, longdouble# #Name = Half, Float, Double, LongDouble# #NAME = HALF, FLOAT, DOUBLE, LONGDOUBLE# #hascomplex = 0, 1, 1, 1#
static npy_hash_t ulong_arrtype_hash ( PyObject *  obj) [static]
end repeat*
static npy_hash_t void_arrtype_hash ( PyObject *  obj) [static]
we used to just hash the pointer
now use tuplehash algorithm using voidtype_item to get the object
Cannot hash mutable void scalars
static PyObject* void_arrtype_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  NPY_UNUSEDkwds 
) [static]
For a VOID scalar first see if obj is an integer or long and create new memory of that size (filled with 0) for the scalar
static void void_dealloc ( PyVoidScalarObject v) [static]
static int voidtype_ass_item ( PyVoidScalarObject self,
Py_ssize_t  n,
PyObject *  val 
) [static]
static int voidtype_ass_subscript ( PyVoidScalarObject self,
PyObject *  ind,
PyObject *  val 
) [static]
Much like in voidtype_setfield, we cannot simply use ndarray's __setitem__ since assignment to void scalars should not broadcast the lhs. Instead we get a view through __getitem__ and then assign the value using setitem with an empty tuple (which treats both object arrays and subarrays properly).
Also we do not want to use voidtype_setfield here, since we do not need to do the (slow) view safety checks, since we already know the dtype/offset are safe.
  1. Convert to 0-d array and use getitem
  1. Assign the value using setitem with empty tuple.
try to convert it to a number
static PyObject* voidtype_base_get ( PyVoidScalarObject self) [static]
static PyObject* voidtype_dtypedescr_get ( PyVoidScalarObject self) [static]

Referenced by voidtype_getfield().

static PyObject* voidtype_flags_get ( PyVoidScalarObject self) [static]

Referenced by voidtype_getfield().

static PyObject* voidtype_getfield ( PyVoidScalarObject self,
PyObject *  args,
PyObject *  kwds 
) [static]
end repeat*
Use ndarray's getfield to obtain the field safely

References voidtype_dtypedescr_get(), and voidtype_flags_get().

static PyObject* voidtype_item ( PyVoidScalarObject self,
Py_ssize_t  n 
) [static]
static Py_ssize_t voidtype_length ( PyVoidScalarObject self) [static]
end repeat*
******* As_mapping functions for void array scalar *******
return the number of fields

References PyBytes_GET_SIZE.

static PyObject* voidtype_setfield ( PyVoidScalarObject self,
PyObject *  args,
PyObject *  kwds 
) [static]
We would like to use ndarray's setfield because it performs safety checks on the field datatypes and because it broadcasts properly. However, as a special case, void-scalar assignment broadcasts differently from ndarrays when assigning to an object field: Assignment to an ndarray object field broadcasts, but assignment to a void-scalar object-field should not, in order to allow nested ndarrays. These lines should then behave identically: <blockquote> b = np.zeros(1, dtype=[('x', 'O')]) b[0]['x'] = arange(3) # uses voidtype_setfield b['x'][0] = arange(3) # uses ndarray setitem</blockquote>
Ndarray's setfield would try to broadcast the lhs. Instead we use ndarray getfield to get the field safely, then setitem with an empty tuple to set the value without broadcast. Note we also want subarrays to be set properly, ie <blockquote> a = np.zeros(1, dtype=[('x', 'i', 5)]) a[0]['x'] = 1</blockquote>
sets all values to 1. "getfield + setitem with empty tuple" takes care of both object arrays and subarrays.
  1. Convert to 0-d array and use getfield
  1. Assign the value using setitem with empty tuple.
static PyObject * voidtype_subscript ( PyVoidScalarObject self,
PyObject *  ind 
) [static]
get field by name or number
try to convert it to a number

Variable Documentation

static PyNumberMethods name _arrtype_as_number [static]
begin repeat
name = byte, short, int, long, ubyte, ushort, longlong, uint,
ulong, ulonglong#
#Name = Byte, Short, Int, Long, UByte, UShort, LongLong, UInt,
ULong, ULongLong#
#type = PyInt_FromLong*6, PyLong_FromLongLong*1,
PyLong_FromUnsignedLong*2, PyLong_FromUnsignedLongLong#
end repeat*
begin repeat
name = half, float, double, longdouble,
cfloat, cdouble, clongdouble#
#NAME = Half, Float, Double, LongDouble,
CFloat, CDouble, CLongDouble#
Initial value:
 {
    "years",
    "months",
    "weeks",
    "<invalid>",
    "days",
    "hours",
    "minutes",
    "seconds",
    "milliseconds",
    "microseconds",
    "nanoseconds",
    "picoseconds",
    "femtoseconds",
    "attoseconds",
    "generic time units"
}
This table describes safe casting for small type numbers, and is used by PyArray_CanCastSafely.
This table gives the type of the same kind, but next in the sequence of sizes.
end repeat*
This table maps the built-in type numbers to their scalar type numbers. Note that signed integers are mapped to INTNEG_SCALAR, which is different than what PyArray_ScalarKind returns.

Referenced by PyArray_Concatenate().

This table maps a scalar kind (excluding NPY_NOSCALAR) to the smallest type number of that kind.

Referenced by PyArray_CanCastScalar().

This table gives the smallest-size and smallest-kind type to which the input types may be safely cast, according to _npy_can_cast_safely.
Initial value:
 {
    {PyObject_HEAD_INIT(&PyBoolArrType_Type) 0},
    {PyObject_HEAD_INIT(&PyBoolArrType_Type) 1},
}
NPY_NO_EXPORT PyTypeObject Py NAME ArrType_Type
Inheritance is established later when tp_bases is set (or tp_base for single inheritance)
begin repeat
name = number, integer, signedinteger, unsignedinteger, inexact,
floating, complexfloating, flexible, character#
#NAME = Number, Integer, SignedInteger, UnsignedInteger, Inexact,
Floating, ComplexFloating, Flexible, Character#
begin repeat
name = bool, string, unicode, void# #NAME = Bool, String, Unicode, Void# #ex = _,_,_,#
end repeat*
begin repeat
#NAME = Byte, Short, Int, Long, LongLong, UByte, UShort, UInt, ULong,
ULongLong, Half, Float, Double, LongDouble, Datetime, Timedelta#
System Message: WARNING/2 (<string>, line 4) Definition list ends without a blank line; unexpected unindent.

name = int*5, uint*5, float*4, datetime, timedelta# #CNAME = (CHAR, SHORT, INT, LONG, LONGLONG)*2, HALF, FLOAT, DOUBLE,

System Message: ERROR/3 (<string>, line 6) Unexpected indentation.

<blockquote class="last"> LONGDOUBLE, DATETIME, TIMEDELTA#</blockquote>

Referenced by _fill().

Arithmetic methods -- only so we can override &, |, ^.

System Message: WARNING/2 (<string>, line 1); backlink Inline substitution_reference start-string without end-string.
PyNumberMethods clongdoubletype_as_number [static]
char doc_getarray[] = "sc.__array__(|type) return 0-dim array" [static]
0-dim array from scalar object
char doc_sc_wraparray[] = "sc.__array_wrap__(obj) return scalar from array" [static]
PyBufferProcs gentype_as_buffer [static]
Initial value:
releasebuffer is not needed
PyMappingMethods gentype_as_mapping [static]
Initial value:
 {
    NULL,
    (binaryfunc)gen_arrtype_subscript,
    NULL
}
end repeat*
PyNumberMethods gentype_as_number [static]
end repeat*

<

!defined(NPY_PY3K)
PyGetSetDef gentype_getsets[] [static]
PyMethodDef gentype_methods[] [static]
end repeat*
need to fill in doc-strings for these methods on import -- copy from array docstrings
PyGetSetDef inttype_getsets[] [static]
Initial value:
 {
    {"numerator",
        (getter)inttype_numerator_get,
        (setter)0,
        "numerator of value (the value itself)",
        NULL},
    {"denominator",
        (getter)inttype_denominator_get,
        (setter)0,
        "denominator of value (1)",
        NULL},
    {NULL, NULL, NULL, NULL, NULL}
}
PyNumberMethods longdoubletype_as_number [static]
PyBufferProcs object_arrtype_as_buffer [static]
Initial value:
 {

    (readbufferproc)object_arrtype_getreadbuf,
    (writebufferproc)object_arrtype_getwritebuf,
    (segcountproc)object_arrtype_getsegcount,
    (charbufferproc)object_arrtype_getcharbuf,

    (getbufferproc)object_arrtype_getbuffer,
    (releasebufferproc)object_arrtype_releasebuffer,
}
PyMappingMethods object_arrtype_as_mapping [static]
Initial value:
PySequenceMethods object_arrtype_as_sequence [static]
Initial value:
 {
    (lenfunc)object_arrtype_length,              
    (binaryfunc)object_arrtype_concat,           
    (ssizeargfunc)object_arrtype_repeat,         
    0,                                           
    0,                                           
    0,                                           
    0,                                           
    (objobjproc)object_arrtype_contains,         
    (binaryfunc)object_arrtype_inplace_concat,   
    (ssizeargfunc)object_arrtype_inplace_repeat, 
}
TimeInteger is deleted, but still here to fill the API slot
PyMethodDef name type_methods[] [static]
Initial value:
 {
    {"__complex__",
        (PyCFunction)@name@_complex,
        METH_VARARGS | METH_KEYWORDS, NULL},
    {NULL, NULL, 0, NULL}
}
begin repeat
name = cfloat,clongdouble#
Initial value:
 {
    {&PyBoolArrType_Type, NPY_BOOL},
    {&PyByteArrType_Type, NPY_BYTE},
    {&PyUByteArrType_Type, NPY_UBYTE},
    {&PyShortArrType_Type, NPY_SHORT},
    {&PyUShortArrType_Type, NPY_USHORT},
    {&PyIntArrType_Type, NPY_INT},
    {&PyUIntArrType_Type, NPY_UINT},
    {&PyLongArrType_Type, NPY_LONG},
    {&PyULongArrType_Type, NPY_ULONG},
    {&PyLongLongArrType_Type, NPY_LONGLONG},
    {&PyULongLongArrType_Type, NPY_ULONGLONG},
    {&PyFloatArrType_Type, NPY_FLOAT},
    {&PyDoubleArrType_Type, NPY_DOUBLE},
    {&PyLongDoubleArrType_Type, NPY_LONGDOUBLE},
    {&PyCFloatArrType_Type, NPY_CFLOAT},
    {&PyCDoubleArrType_Type, NPY_CDOUBLE},
    {&PyCLongDoubleArrType_Type, NPY_CLONGDOUBLE},
    {&PyObjectArrType_Type, NPY_OBJECT},
    {&PyStringArrType_Type, NPY_STRING},
    {&PyUnicodeArrType_Type, NPY_UNICODE},
    {&PyVoidArrType_Type, NPY_VOID},
    {&PyDatetimeArrType_Type, NPY_DATETIME},
    {&PyTimedeltaArrType_Type, NPY_TIMEDELTA},
    {&PyHalfArrType_Type, NPY_HALF}
}
PyMappingMethods voidtype_as_mapping [static]
Initial value:
 {
    (lenfunc)voidtype_length,                    
    (binaryfunc)voidtype_subscript,              
    (objobjargproc)voidtype_ass_subscript,       
}
PySequenceMethods voidtype_as_sequence [static]
Initial value:
 {
    (lenfunc)voidtype_length,                    
    0,                                           
    0,                                           
    (ssizeargfunc)voidtype_item,                 
    0,                                           
    (ssizeobjargproc)voidtype_ass_item,          
    0,                                           
    0,                                           
    0,                                           
    0,                                           
}
PyGetSetDef voidtype_getsets[] [static]
Initial value:
 {
    {"flags",
        (getter)voidtype_flags_get,
        (setter)0,
        "integer value of flags",
        NULL},
    {"dtype",
        (getter)voidtype_dtypedescr_get,
        (setter)0,
        "dtype object",
        NULL},
    {"base",
        (getter)voidtype_base_get,
        (setter)0,
        "base object",
        NULL},
    {NULL, NULL, NULL, NULL, NULL}
}
PyMethodDef voidtype_methods[] [static]
Initial value:
 {
    {"getfield",
        (PyCFunction)voidtype_getfield,
        METH_VARARGS | METH_KEYWORDS, NULL},
    {"setfield",
        (PyCFunction)voidtype_setfield,
        METH_VARARGS | METH_KEYWORDS, NULL},
    {NULL, NULL, 0, NULL}
}