On 19/11/2018 15:08, Victor Stinner wrote:
... For me, the limited API should be functions available on all Python implementations. Does it make sense to provide PyFloat_Pack4() in ..., Jython, ... ? Or is it something more specific to CPython? I don't know the answer.
I'd say it's a CPython thing. It is helpful to copy a lot of things from the reference implementation, but generally the lexical conventions of the C-API would seem ludicrous in Java, where scope is already provided by a class. And then there's the impossibility of a C-like pointer to byte. Names related to C-API have mnemonic value, though, in translation. Maybe "static void PyFloat.pack4(double, ByteBuffer, boolean)" would do the trick.
It makes sense for JyNI to supply it by the exact C API name, and all other API that C extensions are likely to use.