diff options
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r-- | numpy/lib/utils.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 400f378a6..db7c00db6 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -1,7 +1,7 @@ import sys, os import inspect import types -from numpy.core.numerictypes import obj2sctype, integer +from numpy.core.numerictypes import obj2sctype, integer, generic from numpy.core.multiarray import dtype as _dtype, _flagdict, flagsobj from numpy.core import product, ndarray @@ -19,7 +19,14 @@ def issubsctype(arg1, arg2): return issubclass(obj2sctype(arg1), obj2sctype(arg2)) def issubdtype(arg1, arg2): - return issubclass(_dtype(arg1).type, _dtype(arg2).type) + if issubclass_(arg2, generic): + return issubclass(_dtype(arg1).type, arg2) + mro = _dtype(arg2).type.mro() + if len(mro) > 1: + val = mro[1] + else: + val = mro[0] + return issubclass(_dtype(arg1).type, val) def get_include(): """Return the directory in the package that contains the numpy/*.h header |