private final static short typeToKind(final char typecode) {
        switch (typecode) {
        case '1':
        case 's':
        case 'i':
        case 'l':
            return PyMultiarray.INTEGER;
        case 'f':
        case 'd':
            return PyMultiarray.FLOATINGPOINT;
        case 'F':
        case 'D':
            return PyMultiarray.COMPLEX;
        case 'O':
            return PyMultiarray.PYOBJECT;
        default:
            throw Py.ValueError("internal error in typeToKind");
        }
    }