Message 173103 - Python tracker (original) (raw)

From the macro posted earlier: Py##child##ArrType_Type.tp_base = &Py##parent2##ArrType_Type;

tp_base is not PyInt_Type, so I was wrong when I said that the dominant base was int. This is wrong IMO: tp_base should be int, for the type to be correctly initialized.

Compare:

from numpy import * print int_.bases, int_.base (<type 'numpy.signedinteger'>, <type 'int'>) <type 'numpy.signedinteger'> class C(signedinteger, int): ... pass ... print C.bases, C.base (<type 'numpy.signedinteger'>, <type 'int'>) <type 'int'>