public static PythonObject bytearray(PythonObject pythonObject) {
        PythonObject baF = attr("bytearray");
        PythonObject ret = baF.call(pythonObject);
        if (ret.isNone()) {
            throw new PythonException("Cannot build bytearray from object: " + pythonObject.toString());