private final static Object objectToJava(PyObject o, final char typecode, final boolean returnReal) {
        if (typecode == 'O') { return o; }
        if (o instanceof PyComplex) {
            o = Py.newFloat(returnReal ? ((PyComplex) o).real
                    : ((PyComplex) o).imag);
        } else if (!returnReal) {
            o = Py.Zero;
        }
        final Object number = o.__tojava__(PyMultiarray.typeToClass(typecode));
        if (number == Py.NoConversion) { throw Py.ValueError("coercion error"); }
        return number;
    }