summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2016-07-15 08:17:48 -0500
committermattip <matti.picus@gmail.com>2016-07-18 19:26:37 +0300
commit52e09e86cf4085cbfed90d81606566a282162554 (patch)
tree9902892a66d72ed6dc5ef4e869b86e36fb8c9350
parent9a3eb4bf7941cbc0238760d6b43bb55ee9a04057 (diff)
downloadnumpy-52e09e86cf4085cbfed90d81606566a282162554.tar.gz
ENH: set reasonable defaults for slots before PyType_Ready is called, enables overriding them later
-rw-r--r--numpy/core/src/multiarray/scalartypes.c.src2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src
index 08505c5c7..5054fa850 100644
--- a/numpy/core/src/multiarray/scalartypes.c.src
+++ b/numpy/core/src/multiarray/scalartypes.c.src
@@ -4080,6 +4080,7 @@ initialize_numeric_types(void)
/*
* 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
@@ -4088,6 +4089,7 @@ initialize_numeric_types(void)
* #NAME = Byte, Short, Int, Long, LongLong, UByte, UShort,
* UInt, ULong, ULongLong#
*/
+ @name@_arrtype_as_number = gentype_as_number;
Py@NAME@ArrType_Type.tp_as_number = &@name@_arrtype_as_number;
Py@NAME@ArrType_Type.tp_as_number->nb_index = (unaryfunc)@name@_index;