News for hackers. Stuff that matters.
Re:Inside cpyext: Why emulating CPython C API is so Hard by aportnoy on Friday September 21, 2018 @02:18PM (#18041586)
Can anyone point to an introduction to CPython internals? My goal is to write a Python extension in C that manipulates Python objects.
Re:Inside cpyext: Why emulating CPython C API is so Hard by mjw1007 on Friday September 21, 2018 @02:22PM (#18041621)
Re:Inside cpyext: Why emulating CPython C API is so Hard by Too on Saturday September 22, 2018 @02:42AM (#18044835)
Try boost-python, SWIG or cython instead. They give you a nicer c++ api and automatically handles ref-counting, exception handling and other things that are easy to forget.

https://www.boost.org/doc/libs/1_61_0/libs/python/doc/html/t...

Re:Inside cpyext: Why emulating CPython C API is so Hard by eesmith on Saturday September 22, 2018 @03:18AM (#18044921)
How is the Boost/PyPy integration? Sure, there's cpyext, so in principle a Boost-generated extension can be used by pypy.

Are there any changes which would make Boost-based extensions better integrated/supported by PyPy?

The linked-to document only talks about Cython and cffi.

Re:Inside cpyext: Why emulating CPython C API is so Hard by mattip on Saturday September 22, 2018 @05:48AM (#18045297)
There is cppyy, which is cffi for c++. Boost python is not being maintained, in the cpython world pybind11 is more popular but cppyy is pypy freindly
Re:Inside cpyext: Why emulating CPython C API is so Hard by eesmith on Saturday September 22, 2018 @08:07AM (#18045679)
Boost isn't being maintained? I did not know that. One of the project I use often - F/OSS but I'm a user, not core developer - uses Boost for C++/Python integration. They chose it many years ago. This topic has never come up on the mailing list or user group meetings. I suspect that since Boost "just works", no one has care to re-evaluate that decision.

Thanks for the pointers to what's going on in the C++/python integration layer. I'll experiment with it.

Re:Inside cpyext: Why emulating CPython C API is so Hard by zerkten on Friday September 21, 2018 @02:57PM (#18041853)
There is a full course on the subject at http://www.pgbovine.net/cpython-internals.htm.
Re:Inside cpyext: Why emulating CPython C API is so Hard by AdamM12 on Friday September 21, 2018 @05:55PM (#18042952)
This looks really interesting. Saving for later as I've been wanting to dive into python much more.
Re:Inside cpyext: Why emulating CPython C API is so Hard by pvg on Friday September 21, 2018 @02:39PM (#18041738)
Depending on what you're trying to do, Cython might be a slightly easier option as well.