[Python-Dev] Experiment an opt-in new C API for Python? (leave current API unchanged)

Jeff Allen ja.py at farowl.co.uk
Mon Nov 19 14:16:21 EST 2018


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.

Jeff Allen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20181119/11561f7b/attachment.html>


More information about the Python-Dev mailing list