Hi,

I tried to pass a bytearray and that's also not currently supported.

no, it really expects an std::string object to be passed through an
std::string*, as Amaury advised. Any other type would require the creation
of a temporary. (A C++ string is not a byte array. Typically, it carries a
length data member and a pointer to what is a byte array. Further, for
short strings, those data members can be used as the actual payload.)

Any clue about what should I do with the exception? It definitely shouldn't
crash the process. I need it to raise a python exception instead.

Right, which is done on the CPython side. Haven't gotten around to implement
the same on the PyPy side. Isn't hard, but takes time. (There's a separate
issue for the cling backend, where we have yet to move to MCJit, which is
needed to support C++ exceptions through LLVM JIT-ted code.)

Likewise, returning out-parameters in a tuple is a nice pythonization that
is on the TODO-list (which is long). Lacking time, again.

Of course, this can be fixed on the python side also, by replacing the bound
function with one that creates a temporary s = std.string(), calls the
original function, then returns an str(s).

Best regards,
           Wim
--
wlavrij...@lbl.gov    --    +1 (510) 486 6411    --    www.lavrijsen.net
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to